/* ========================================
   Portfolio Styles - Asier Dev
   Modern, accessible, performant
   ======================================== */

/* Import modern typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ----------------------------------------
   CSS Custom Properties (Design Tokens)
   ---------------------------------------- */
:root {
  color-scheme: light dark;

  /* Animation timings */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

html[data-theme="dark"] {
  --bg: #0a0e14;
  --bg-subtle: #0f1419;
  --card: #111820;
  --card-hover: #161e28;
  --text: #e9eef5;
  --text-secondary: #c5cdd8;
  --muted: #8899aa;
  --line: #1e2a3a;
  --line-hover: #2a3a4a;
  --acc: #7aa2ff;
  --acc-secondary: #a78bfa;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --card-hover: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-hover: #cbd5e1;
  --acc: #3b82f6;
  --acc-secondary: #8b5cf6;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------
   Base Reset & Global Styles
   ---------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  transition: background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------
   Accessibility
   ---------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 20px;
  background: var(--acc);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  z-index: 1000;
  font-weight: 500;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------
   Links
   ---------------------------------------- */
a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

a:hover {
  color: var(--acc);
  border-bottom-color: var(--acc);
}

/* ----------------------------------------
   Layout
   ---------------------------------------- */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px;
}

@media (max-width: 600px) {
  .wrap {
    padding: 32px 16px;
  }
}

/* ----------------------------------------
   Hero Section
   ---------------------------------------- */
.hero {
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.hero-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .hero-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* Animated Gradient Title */
h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
  background: linear-gradient(135deg,
      var(--acc) 0%,
      var(--acc-secondary) 50%,
      var(--acc) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.subtitle {
  color: var(--text);
  font-size: 1.125rem;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.muted {
  color: var(--muted);
  margin-bottom: 0;
  /* Removed bottom margin to fix "weird spacing" */
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.6;
}

.hero-text {
  flex: 1;
}

.links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ----------------------------------------
   Controls (Theme & Language)
   ---------------------------------------- */
.controls {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  border-color: var(--acc);
  color: var(--text);
  background: var(--bg-subtle);
}

.btn:active {
  transform: scale(0.97);
}

/* ----------------------------------------
   Section Titles
   ---------------------------------------- */
h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ----------------------------------------
   Project Cards
   ---------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 14px 0;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    background-color var(--transition-base);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--line-hover);
  background: var(--card-hover);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tag {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border-radius: 6px;
  white-space: nowrap;
}

.card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card .links {
  margin-top: 14px;
  gap: 12px;
}

.card .links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--acc);
  border-bottom: none;
  padding: 4px 0;
}

.card .links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------
   Tech Stack Pills
   ---------------------------------------- */
.tech-stack-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  margin-bottom: 24px;
}

.pill {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: default;
}

.pill:hover {
  border-color: var(--acc);
  color: var(--acc);
  transform: translateY(-1px);
}

/* ----------------------------------------
   Project Card Icons & Visuals
   ---------------------------------------- */
.card-head-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.25rem;
  flex-shrink: 0;
}



.npm-badge {
  border-bottom: none;
  display: flex;
  align-items: center;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.npm-badge:hover {
  border-bottom: none;
  transform: scale(1.05);
  opacity: 0.9;
}

.npm-badge img {
  height: 22px;
  border-radius: 4px;
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */
@media print {
  body {
    background: white;
    color: black;
  }

  .controls,
  .skip-link {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  h1 {
    -webkit-text-fill-color: initial;
    background: none;
    color: black;
  }

  a {
    color: black;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}