/* ==========================================================================
   3aks.me — Developer Portfolio
   Clean, compact, high-contrast engineering layout
   Author: Arjun Sharma
   ========================================================================== */

:root {
  /* Color System: Deep Pitch Black with Glass Surfaces & Orange/Blue Accents */
  --bg-page: #08080a;
  --bg-surface: rgba(18, 18, 22, 0.75);
  --bg-surface-elevated: rgba(28, 28, 36, 0.85);
  --bg-surface-hover: rgba(38, 38, 48, 0.9);

  --border-default: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: #38bdf8;

  /* Blue & Orange Accents */
  --accent-sky: #38bdf8;
  --accent-blue: #0284c7;
  --accent-sky-dim: rgba(56, 189, 248, 0.14);
  --accent-orange: #f97316;
  --accent-orange-bright: #ff6a00;
  --accent-orange-dim: rgba(249, 115, 22, 0.14);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.12);

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Typography */
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --max-width: 980px;
  --radius-sm: 6px;
  --radius-md: 10px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

/* Centered Container */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-sky);
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
}

/* ==========================================================================
   Ambient Interactive Gradient Circles Background (Orange & Blue)
   ========================================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: var(--bg-page);
}

.gradient-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(95px);
  will-change: transform;
  mix-blend-mode: screen;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* Primary Cyan/Blue Orb - Top Left / Center */
.orb-blue-1 {
  width: 650px;
  height: 650px;
  top: -120px;
  left: 5%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, rgba(56, 189, 248, 0.16) 45%, transparent 70%);
}

/* Primary Radiant Orange Orb - Top Right / Hero */
.orb-orange-1 {
  width: 700px;
  height: 700px;
  top: 8%;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 106, 0, 0.38) 0%, rgba(249, 115, 22, 0.16) 50%, transparent 70%);
}

/* Secondary Deep Blue / Indigo Orb - Midpage / Skills */
.orb-blue-2 {
  width: 750px;
  height: 750px;
  top: 48%;
  left: -140px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.32) 0%, rgba(59, 130, 246, 0.14) 48%, transparent 72%);
}

/* Secondary Warm Orange / Amber Orb - Lower / Terminal & Contact */
.orb-orange-2 {
  width: 650px;
  height: 650px;
  bottom: -100px;
  right: 8%;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.3) 0%, rgba(234, 88, 12, 0.14) 50%, transparent 70%);
}

.ambient-mesh {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  opacity: 0.55;
}

/* ==========================================================================
   Startup Intro Screen: Scramble to Header Bar Animation
   ========================================================================== */
.startup-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #08090b;
  z-index: 10000;
  pointer-events: all;
  user-select: none;
}

.startup-scramble-wrap {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
}

.scramble-brand {
  font-family: var(--font-mono);
  font-size: clamp(1.85rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  user-select: none;
  line-height: 1;
}

.scramble-bracket {
  color: var(--accent-sky);
}

.scramble-text {
  color: var(--text-main);
}

.scramble-accent {
  color: var(--accent-sky);
}

/* ==========================================================================
   Header & Nav (Permanently Fixed at the Top)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color 0.25s ease, background-color 0.25s ease, backdrop-filter 0.25s ease;
}

main {
  margin-top: 56px;
  position: relative;
  z-index: 1;
}

.header-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  pointer-events: none;
}

.site-header.scrolled {
  background: rgba(8, 8, 10, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

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

.brand-logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* Nav & Hero entrance visibility during intro */
body.intro-running #siteLogo {
  opacity: 0;
  visibility: hidden;
}

body:not(.intro-running) #siteLogo {
  opacity: 1;
  visibility: visible;
}

body.intro-running .desktop-nav .nav-link,
body.intro-running #navGithubLink,
body.intro-running #mobileMenuBtn,
body.intro-running .hero-status,
body.intro-running .hero-heading,
body.intro-running .hero-lead,
body.intro-running .hero-actions,
body.intro-running .quick-facts,
body.intro-running .code-card,
body.intro-running .scroll-item {
  opacity: 0;
}

body.intro-running .section-line,
body.intro-running .header-line,
body.intro-running #heroLine {
  transform: scaleX(0);
}

.logo-bracket {
  color: var(--accent-sky);
  transition: transform 0.15s ease;
}

.brand-logo:hover .logo-bracket {
  transform: scale(1.18);
}

.logo-accent {
  color: var(--accent-sky);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.mobile-toggle .bar {
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-toggle.active .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-toggle.active .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile Drawer: hidden on desktop, only active on mobile screens */
.mobile-nav {
  display: none;
}

.mobile-nav-link {
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mobile-nav-link:hover {
  color: var(--text-main);
}

.mobile-nav-link.highlight {
  color: var(--accent-sky);
  border-bottom: none;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #f3f4f6;
  color: #0e0f12;
  font-weight: 600;
}

.btn-primary:hover {
  background: #ffffff;
  color: #000;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: #3b3e47;
}

.btn-subtle {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-default);
}

.btn-subtle:hover {
  color: var(--text-main);
  border-color: #4a4e59;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.82rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding-top: 36px;
  padding-bottom: 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 36px;
  align-items: start;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #34d399;
  font-family: var(--font-mono);
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

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

.hero-heading {
  font-size: clamp(1.85rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.hero-line {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  margin-top: 18px;
  margin-bottom: 18px;
}

.quick-facts {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 0;
  border-top: none;
}

.fact {
  display: flex;
  flex-direction: column;
}

.fact-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.fact-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.fact-separator {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* Code Card */
.code-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.card-topbar {
  background: #141518;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.window-buttons {
  display: flex;
  gap: 5px;
}

.win-btn {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.win-btn.close { background: #ef4444; }
.win-btn.min { background: #f59e0b; }
.win-btn.max { background: #10b981; }

.card-filename {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.card-code {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  background: #0c0d0f;
  overflow-x: auto;
}

.token-keyword { color: #f43f5e; }
.token-string { color: #34d399; }
.token-type { color: #38bdf8; }
.token-func { color: #c084fc; }
.token-prop { color: #cbd5e1; }

.card-bottom {
  padding: 6px 12px;
  background: #141518;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.card-chip-tag {
  color: var(--accent-emerald);
}

/* ==========================================================================
   Sections (Tightened Spacing)
   ========================================================================== */
.section {
  position: relative;
  padding: 42px 0;
  scroll-margin-top: 72px;
  border-top: none;
}

.section-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--border-default);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  pointer-events: none;
  will-change: transform;
}

/* Universal scroll-reveal initial state (when js-ready is active) */
html.js-ready main section.section:not(.animated) .scroll-item {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

html.js-ready main section.section:not(.animated) .section-line {
  transform: scaleX(0);
  will-change: transform;
}

main section.section.animated .scroll-item {
  opacity: 1;
  transform: none;
}

main section.section.animated .section-line {
  transform: scaleX(1);
}

.section-title {
  font-size: 1.45rem;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

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

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* About Section */
.about-content {
  max-width: 720px;
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   Projects Section (2-Column Card Grid)
   ========================================================================== */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: var(--text-main);
}

.filter-tab.active {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.project-item:hover {
  border-color: #3b3e47;
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.project-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-heading {
  font-size: 1.05rem;
}

.project-heading a {
  color: var(--text-main);
}

.project-heading a:hover {
  color: var(--accent-sky);
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-sky);
  background: var(--accent-sky-dim);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: #141518;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-sky);
}

.link-label:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.skill-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.col-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--text-main);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clean-list li {
  font-size: 0.86rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-list li::before {
  content: "—";
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Terminal CLI Section
   ========================================================================== */
.terminal-window {
  max-width: 860px;
  margin: 0 auto;
  background: #0b0c0e;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(255, 255, 255, 0.02);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-titlebar {
  background: #141518;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

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

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot.close { background: #ff5f56; }
.terminal-dot.minimize { background: #ffbd2e; }
.terminal-dot.zoom { background: #27c93f; }

.terminal-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: #4a4e59;
}

.terminal-quick-pills {
  background: #101114;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.term-pill {
  background: #181a1f;
  border: 1px solid var(--border-default);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.term-pill:hover {
  background: var(--text-main);
  color: #0b0c0e;
  border-color: var(--text-main);
}

.terminal-body {
  padding: 20px;
  min-height: 240px;
  max-height: 380px;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  background: #0b0c0e;
}

.terminal-line {
  margin-bottom: 8px;
  word-break: break-word;
}

.term-dim { color: var(--text-dim); }
.term-highlight { color: var(--accent-sky); font-weight: 600; }
.term-orange { color: var(--accent-orange); font-weight: 600; }
.term-success { color: #34d399; }
.term-warning { color: #fbbf24; }
.term-error { color: #f87171; }
.term-cmd { color: #f8fafc; font-weight: 600; }

/* Custom Terminal Error Cards */
.term-error-box {
  margin: 8px 0;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.5;
}

.term-error-box.auth {
  background: rgba(249, 115, 22, 0.08);
  border-left-color: var(--accent-orange);
}

.term-error-box.forbidden {
  background: rgba(239, 68, 68, 0.09);
  border-left-color: #ef4444;
}

.term-error-box.server {
  background: rgba(244, 63, 94, 0.08);
  border-left-color: #f43f5e;
}

.term-error-box.notfound {
  background: rgba(56, 189, 248, 0.08);
  border-left-color: var(--accent-sky);
}

.term-error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 4px;
}

.term-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.term-badge.b-401 {
  background: rgba(249, 115, 22, 0.22);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.term-badge.b-403 {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.term-badge.b-404 {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.term-badge.b-500 {
  background: rgba(244, 63, 94, 0.22);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.term-error-desc {
  color: #d1d5db;
  margin-bottom: 4px;
}

.term-error-hint {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ==========================================================================
   Dedicated Error Page (404.html / Custom Status Codes)
   ========================================================================== */
.error-page-section {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.error-card {
  max-width: 640px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  padding: 36px 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.error-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 20px;
}

.error-status-badge.b-401 {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.error-status-badge.b-403 {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-status-badge.b-404 {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.error-status-badge.b-500 {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.error-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.error-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.error-terminal-preview {
  background: #090a0d;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text-muted);
}

.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  background: #101114;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
}

.terminal-prompt {
  font-size: 0.86rem;
  white-space: nowrap;
  user-select: none;
}

.prompt-user { color: var(--accent-sky); font-weight: 600; }
.prompt-at { color: var(--text-dim); }
.prompt-host { color: #a855f7; font-weight: 600; }
.prompt-path { color: #38bdf8; }

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-main);
  caret-color: var(--accent-sky);
}

/* ==========================================================================
   Contact Box
   ========================================================================== */
.contact-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}

.contact-heading {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.contact-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
  max-width: 540px;
}

.contact-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  padding: 18px 0 20px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.84rem;
  color: #cbd5e1;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-left-text {
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.5;
}

.footer-left-text strong {
  color: #ffffff;
  font-weight: 600;
}

.footer-right-text {
  color: #94a3b8;
  font-size: 0.82rem;
}

/* Toast */
.toast-area {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

/* ==========================================================================
   Comprehensive Responsive System
   ========================================================================== */

/* Tablet Landscape & Medium Desktops (<= 900px) */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

/* Tablet Portrait (<= 768px) */
@media (max-width: 768px) {
  .section {
    padding: 32px 0;
  }

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

/* Phablets & Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  .desktop-nav {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #141518;
    border-bottom: 1px solid var(--border-default);
    padding: 14px 20px 18px;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.75);
    z-index: 99;
  }

  .mobile-nav.open {
    display: flex;
  }

  .hero-section {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

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

  .terminal-body {
    padding: 14px 12px;
    font-size: 0.82rem;
    min-height: 180px;
    max-height: 300px;
  }

  .terminal-quick-pills {
    padding: 8px 12px;
    gap: 6px;
  }

  .term-pill {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer-left-text {
    justify-content: center;
  }
}

/* Standard Smartphones (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-status {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .hero-lead {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 14px;
  }

  .quick-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 14px;
  }

  .fact-val {
    font-size: 0.95rem;
  }

  .fact-label {
    font-size: 0.7rem;
  }

  .fact-separator {
    display: none;
  }

  .card-code {
    font-size: 0.72rem;
    padding: 10px 12px;
  }

  .project-item {
    padding: 14px 16px;
  }

  .project-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .project-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .terminal-title {
    font-size: 0.74rem;
    max-width: 170px;
  }

  .terminal-input-row {
    padding: 10px 12px;
  }

  /* Shorten CLI prompt on small mobile to maximize input typing room */
  .prompt-user, .prompt-at {
    display: none;
  }

  .contact-box {
    padding: 20px 16px;
  }

  .contact-buttons {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .contact-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

/* Compact Smartphones (<= 380px) */
@media (max-width: 380px) {
  .nav-actions #navGithubLink span {
    display: none;
  }

  .nav-actions #navGithubLink {
    padding: 6px 8px;
  }

  .brand-logo {
    font-size: 1.05rem;
  }

  .terminal-title {
    max-width: 130px;
  }

  .quick-facts {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  .header-line,
  .hero-line,
  .section-line {
    transform: scaleX(1) !important;
  }

  body.intro-running #siteLogo,
  body.intro-running .desktop-nav .nav-link,
  body.intro-running #navGithubLink,
  body.intro-running #mobileMenuBtn,
  body.intro-running .hero-status,
  body.intro-running .hero-heading,
  body.intro-running .hero-lead,
  body.intro-running .hero-actions,
  body.intro-running .quick-facts,
  body.intro-running .code-card,
  body.js-ready .scroll-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
  }
}
