/*
Theme Name: Kiran Khadka - Premium Portfolio
Theme URI: https://khadkakiran.com.np
Description: Premium personal portfolio for Kiran Khadka, Full Stack Developer
Version: 1.0.0
Author: Kiran Khadka
Author URI: https://khadkakiran.com.np
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kk-portfolio
Domain Path: /languages
*/

/* ============================================================================
   DESIGN SYSTEM
   ============================================================================ */

:root {
  /* Colors */
  --color-primary-text: #1a1a1a;
  --color-secondary-text: #666666;
  --color-background: #fafaf9;
  --color-surface: #ffffff;
  --color-border: #d4cfc4;
  --color-accent: #0f766e;
  --color-accent-light: #14b8a6;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;

  /* Typography */
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --font-family-mono: 'Courier New', Courier, monospace;

  /* Sizing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-2xl: 64px;

  /* Typography Scales */
  --text-xs: 14px;
  --text-sm: 15px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: 32px;
  --text-5xl: 40px;
  --text-6xl: 48px;
  --text-7xl: 56px;

  /* Line Heights */
  --lh-tight: 1.2;
  --lh-snug: 1.375;
  --lh-normal: 1.5;
  --lh-relaxed: 1.625;
  --lh-loose: 1.75;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-base: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;

  /* Content Width */
  --content-max-width: 1200px;
  --content-padding: var(--spacing-sm);
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--color-primary-text);
  background-color: var(--color-background);
  overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--lh-snug);
  color: var(--color-primary-text);
}

h1 {
  font-size: var(--text-6xl);
  font-weight: 700;
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--spacing-md);
  line-height: var(--lh-relaxed);
  color: var(--color-secondary-text);
  max-width: 65ch;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-light);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================================================
   LISTS
   ============================================================================ */

ul, ol {
  margin-left: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  line-height: var(--lh-relaxed);
}

li {
  margin-bottom: var(--spacing-sm);
  color: var(--color-secondary-text);
}

/* ============================================================================
   CODE
   ============================================================================ */

code, pre {
  font-family: var(--font-family-mono);
  background-color: #f5f5f5;
  border-radius: var(--radius-base);
}

code {
  padding: 2px 6px;
  font-size: 0.9em;
}

pre {
  padding: var(--spacing-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
  line-height: var(--lh-snug);
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.button {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
}

.button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.button-primary {
  background-color: var(--color-accent);
  color: white;
}

.button-primary:hover {
  background-color: var(--color-accent-light);
  text-decoration: none;
}

.button-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-border);
}

.button-secondary:hover {
  background-color: var(--color-background);
  border-color: var(--color-accent);
  text-decoration: none;
}

.button-small {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.container {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
}

.section {
  padding: var(--spacing-2xl) 0;
}

.section-hero {
  padding: var(--spacing-2xl) 0 var(--spacing-xl) 0;
  background-color: var(--color-surface);
}

.section-dark {
  background-color: #f9f8f7;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

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

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

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

/* Flexbox */
.flex {
  display: flex;
  gap: var(--spacing-md);
}

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

.flex-between {
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

/* ============================================================================
   IMAGES
   ============================================================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.image-responsive {
  width: 100%;
  height: auto;
}

.image-square {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.image-portrait {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

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

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

.text-small {
  font-size: var(--text-sm);
  color: var(--color-secondary-text);
}

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

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

.text-bold {
  font-weight: 600;
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }

.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

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

/* ============================================================================
   FORMS
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: var(--spacing-sm);
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  color: var(--color-primary-text);
  transition: border-color var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--color-primary-text);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
  :root {
    --spacing-2xl: 48px;
    --spacing-xl: 32px;
    --text-6xl: 40px;
    --text-5xl: 32px;
  }

  h1 {
    font-size: var(--text-5xl);
  }

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

@media (max-width: 768px) {
  :root {
    --spacing-2xl: 32px;
    --spacing-xl: 24px;
    --spacing-lg: 24px;
    --content-padding: var(--spacing-md);
    --text-6xl: 32px;
    --text-5xl: 28px;
    --text-4xl: 24px;
  }

  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

  .section {
    padding: var(--spacing-xl) 0;
  }

  .section-hero {
    padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid {
    gap: var(--spacing-md);
  }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

.slide-up {
  animation: slideUp 0.6s ease-out;
}
