/* ============================================================
   XAVI PEÑA — Portfolio
   main.css — Global styles, variables & shared components
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Inter:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --black:        #0D0D0D;
  --yellow:       #F5C518;
  --white:        #FFFFFF;
  --gray:         #8C8C8C;
  --gray-light:   #E5E5E5;
  --gray-dark:    #1A1A1A;
  --bg:           #F8F8F8;

  --font-title:   'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;

  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);

  --transition:   0.2s ease;

  --max-width:    1100px;
  --nav-height:   64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--black);
  line-height: 1.6;
  font-size: 16px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* --- Navigation --- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--yellow);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--gray);
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-links a.active {
  color: var(--yellow);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: clamp(18px, 2vw, 24px); }

.section-title {
  font-family: var(--font-title);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--gray);
  font-size: 16px;
  margin-bottom: 48px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-outline {
  background: transparent;
  color: var(--black);
  border: 1px solid var(--gray-light);
}

.btn-outline:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn-outline-dark {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline-dark:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

/* --- Tags --- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--gray-light);
  color: var(--gray);
  font-size: 12px;
  border-radius: 20px;
  font-weight: 500;
}

.tag-yellow {
  background: rgba(245, 197, 24, 0.12);
  color: var(--yellow);
}

/* --- Project card --- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--gray-dark);
}

.card-body {
  padding: 20px;
}

.card-category {
  font-size: 12px;
  font-weight: 500;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 16px;
}

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

/* --- Footer --- */
footer {
  background: var(--black);
  color: var(--gray);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
}

footer a {
  color: var(--gray);
  transition: color var(--transition);
}

footer a:hover {
  color: var(--yellow);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 16px;
    border-top: 1px solid var(--gray-dark);
  }

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

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 48px 0;
  }
}