/* ===================================
   MKALDEV.ME - Personal Portfolio
   Terminal Aesthetic | Engineering Minimalism
   =================================== */

/* CSS Variables */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --text-primary: #cbd5e1;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --accent-primary: #22d3ee;
  --accent-secondary: #0891b2;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.5);
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --accent-primary: #0891b2;
  --accent-secondary: #06b6d4;
  --border: #cbd5e1;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "JetBrains Mono", monospace;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--accent-primary);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Navigation */
.nav-link {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.2s;
}

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

/* Language Buttons */
.lang-btn {
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

/* Sections */
.section-padding {
  padding: 8rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 4rem 0;
  }
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4rem;
  height: 3px;
  background: var(--accent-primary);
}

/* Skill Cards */
.skill-card {
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.skill-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
}

.skill-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Project Cards */
.project-card {
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition:
    transform 0.2s,
    border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.project-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
}

.project-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.project-tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.project-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Service Cards */
.service-card {
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.service-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
}

/* Contact Cards */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-decoration: none;
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.contact-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
}

/* Form Inputs */
.input-field {
  width: 100%;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

/* Footer */
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent-primary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes cursor-blink {
  0%,
  49% {
    border-right-color: var(--accent-primary);
  }
  50%,
  100% {
    border-right-color: transparent;
  }
}

.typing-text {
  display: inline-block;
  position: relative;
  border-right: 3px solid var(--accent-primary);
  animation:
    typing 2s steps(20, end) forwards,
    cursor-blink 0.7s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}

/* Reveal/Scroll Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal-section {
  opacity: 0;
  animation: slideInUp 0.6s ease-out forwards;
}

.reveal-element {
  opacity: 0;
  animation: slideInUp 0.6s ease-out forwards;
}

.reveal-element:nth-child(1) {
  animation-delay: 0.1s;
}

.reveal-element:nth-child(2) {
  animation-delay: 0.2s;
}

.reveal-element:nth-child(3) {
  animation-delay: 0.3s;
}

.reveal-element:nth-child(4) {
  animation-delay: 0.4s;
}

.reveal-element:nth-child(5) {
  animation-delay: 0.5s;
}

/* Responsive Scaling */
@media (max-width: 1024px) {
  body {
    font-size: 0.95rem;
  }

  h1 {
    font-size: clamp(2.5rem, 7vw, 5rem);
  }

  h2 {
    font-size: clamp(1.75rem, 5vw, 3rem);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
  }

  h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
  }

  .container {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 0.875rem;
  }

  h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  }

  .section-padding {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
  }

  .grid {
    gap: 0.75rem;
  }
}

/* Loading States */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--border) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print Styles */
@media print {
  header,
  footer,
  #theme-toggle,
  .lang-btn {
    display: none;
  }
}

/* Responsive Tweaks */
@media (max-width: 640px) {
  .section-title {
    font-size: 2rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}
