/* 
 * Code Compilation Animation - Main Stylesheet
 * Author: Saleban
 * Description: Developer-focused landing page with code compilation theme
 */

:root {
  --terminal-bg: #0d1117;
  --terminal-border: #21262d;
  --terminal-header: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #7d8590;
  --keyword-color: #ff79c6;
  --string-color: #f1fa8c;
  --comment-color: #6272a4;
  --variable-color: #8be9fd;
  --function-color: #50fa7b;
  --operator-color: #ff79c6;
  --success-color: #238636;
  --cursor-color: #00ff41;
  --matrix-green: #00ff41;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--terminal-bg);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  overflow: hidden;
  position: relative;
}

/* Matrix Background Effect */
.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  animation: matrixPulse 8s ease-in-out infinite;
}

@keyframes matrixPulse {
  0%,
  100% {
    filter: brightness(0.8) contrast(1.1);
  }
  50% {
    filter: brightness(1.2) contrast(1.3);
  }
}

/* Terminal Container */
.terminal-container {
  width: 90%;
  max-width: 800px;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 255, 65, 0.1),
    0 0 20px rgba(0, 255, 65, 0.08), inset 0 0 20px rgba(0, 255, 65, 0.02);
  position: relative;
  z-index: 1;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

/* Terminal Header */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--terminal-header);
  padding: 12px 16px;
  border-bottom: 1px solid var(--terminal-border);
}

.terminal-controls {
  display: flex;
  gap: 8px;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.control.close {
  background: #ff5f56;
}
.control.minimize {
  background: #ffbd2e;
}
.control.maximize {
  background: #27ca3f;
}

.terminal-title {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* Terminal Content */
.terminal-content {
  padding: 24px;
  min-height: 400px;
  position: relative;
}

.code-lines {
  margin-bottom: 24px;
}

.line {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0;
  transform: translateX(-20px);
  animation: typeIn 0.8s ease-out forwards;
}

.line:nth-child(1) {
  animation-delay: 0.5s;
}
.line:nth-child(2) {
  animation-delay: 1.2s;
}
.line:nth-child(3) {
  animation-delay: 2s;
}
.line:nth-child(4) {
  animation-delay: 2.8s;
}
.line:nth-child(5) {
  animation-delay: 3.6s;
}
.line:nth-child(6) {
  animation-delay: 4.4s;
}

@keyframes typeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Syntax Highlighting */
.prompt {
  color: var(--success-color);
  margin-right: 8px;
  font-weight: 700;
}

.command {
  color: var(--text-primary);
}

.keyword {
  color: var(--keyword-color);
  font-weight: 500;
}

.variable {
  color: var(--variable-color);
  margin-left: 8px;
}

.operator {
  color: var(--operator-color);
  margin: 0 8px;
}

.string {
  color: var(--string-color);
}

.semicolon {
  color: var(--text-primary);
}

.comment {
  color: var(--comment-color);
  font-style: italic;
}

.function {
  color: var(--function-color);
}

.dot {
  color: var(--text-primary);
}

.method {
  color: var(--function-color);
}

.parenthesis {
  color: var(--text-primary);
}

.template {
  color: var(--string-color);
}

/* Compiled Output */
.compiled-output {
  opacity: 0;
  transform: translateY(20px);
  animation: compileComplete 1s ease-out 5.5s forwards;
}

@keyframes compileComplete {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.output-line {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
}

.success-icon {
  margin-right: 8px;
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.3);
  }
}

.output-text {
  color: var(--success-color);
  font-weight: 500;
}

/* Hero Text */
.hero-text {
  margin-top: 32px;
  text-align: center;
}

.compiled-name {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  background: linear-gradient(
    135deg,
    #4fc3f7 0%,
    #29b6f6 25%,
    #26c6da 50%,
    #42a5f5 75%,
    #5c6bc0 100%
  );
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.compiled-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: subtitleFade 1s ease-out 6.5s forwards;
}

@keyframes subtitleFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blinking Cursor */
.cursor {
  position: absolute;
  width: 2px;
  height: 20px;
  background: var(--cursor-color);
  animation: blink 1s step-end infinite;
  bottom: 24px;
  left: 24px;
  opacity: 0;
  animation-delay: 0.5s;
}

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

/* Hover Effects */
.compiled-name:hover {
  transform: scale(1.02);
  filter: brightness(1.2);
  transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .terminal-container {
    width: 95%;
    margin: 20px;
  }

  .terminal-content {
    padding: 16px;
  }

  .line {
    font-size: 12px;
  }

  .compiled-name {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .line,
  .compiled-output,
  .compiled-subtitle {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .success-icon {
    animation: none;
  }

  .compiled-name {
    animation: none;
    background: var(--matrix-green);
    -webkit-text-fill-color: var(--matrix-green);
  }
}
