/* ===========================
   Lluc Vivet Torras — Portfolio
   css/style.css
   =========================== */

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

:root {
  --bg: #fafaf8;
  --border: #e2e0d8;
  --text: #1a1916;
  --muted: #7a7870;
  --tag-bg: #ede9e2;
  --tag-text: #4a4842;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --border: #2e2d2a;
    --text: #f0ede6;
    --muted: #8a8880;
    --tag-bg: #2a2927;
    --tag-text: #c0bdb5;
  }
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; }
a { color: inherit; text-decoration: none; }

/* ---- Nav ---- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: 13px; color: var(--muted); transition: color 0.2s; letter-spacing: 0.03em; }
.nav-links a:hover { color: var(--text); }

/* ---- Layout ---- */
main { padding-top: 60px; }
section { max-width: 760px; margin: 0 auto; padding: 6rem 2rem; }
section + section { border-top: 1px solid var(--border); }
.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 3rem; }

/* ---- Hero ---- */
#hero { padding-top: 8rem; padding-bottom: 7rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
.hero-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.hero-name { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.hero-email { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.03em; transition: color 0.2s; }
.hero-email:hover { color: var(--text); }
.hero-social { display: flex; gap: 10px; justify-content: center; }
.hero-cv { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---- About ---- */
.about-text { font-size: 1rem; line-height: 1.85; font-weight: 300; max-width: 600px; }
.about-text p + p { margin-top: 1.2em; }

/* ---- Project Tabs ---- */
.project-tabs { display: flex; gap: 4px; margin-bottom: 2.5rem; }
.project-tab {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 6px 16px; border-radius: 3px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: all 0.18s;
}
.project-tab:hover { color: var(--text); border-color: var(--text); }
.project-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- Projects ---- */
.project-item { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 1rem; padding: 1.75rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.project-item:first-child { border-top: 1px solid var(--border); }
.project-item:hover .project-title { opacity: 0.6; }
.project-meta { display: flex; flex-direction: column; gap: 6px; }
.project-title { font-size: 1rem; font-weight: 400; letter-spacing: -0.01em; transition: opacity 0.2s; }
.project-desc { font-size: 13.5px; color: var(--muted); font-weight: 300; line-height: 1.6; max-width: 440px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-family: var(--mono); font-size: 11px; background: var(--tag-bg); color: var(--tag-text); padding: 3px 9px; border-radius: 3px; letter-spacing: 0.03em; }
.project-arrow { font-size: 18px; color: var(--muted); padding-top: 2px; transition: transform 0.2s, color 0.2s; flex-shrink: 0; }
.project-item:hover .project-arrow { transform: translate(3px, -3px); color: var(--text); }

/* ---- Skills ---- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; border: 1px solid var(--border); }
.skill-group { padding: 1.4rem 1.5rem; background: var(--bg); }
.skill-group-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.85rem; }
.skill-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.skill-list li { font-size: 14px; font-weight: 300; display: flex; align-items: center; gap: 9px; }
.skill-list li svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.skill-icon-wrap { width: 15px; height: 15px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.skill-icon-wrap svg { width: 15px; height: 15px; fill: var(--muted); }

.social-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 3px;
  color: var(--text); background: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.social-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.social-btn:hover svg { color: var(--bg); }
.hero-cv { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Contact section (bottom) ---- */
.contact-section { text-align: center; }
.contact-section .section-label { text-align: center; }
.contact-heading { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 300; letter-spacing: -0.02em; margin-bottom: 1rem; }
.contact-intro { font-size: 1rem; color: var(--muted); font-weight: 300; max-width: 380px; line-height: 1.85; margin: 0 auto 2rem; }

/* ---- CV buttons ---- */
.cv-btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em;
  padding: 10px 22px; border: 1px solid var(--border); border-radius: 3px;
  color: var(--text); background: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.cv-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- Footer ---- */
footer { max-width: 760px; margin: 0 auto; padding: 2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
footer p { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero-label  { animation: fadeUp 0.6s ease both 0.05s; }
.hero-name   { animation: fadeUp 0.6s ease both 0.15s; }
.hero-email  { animation: fadeUp 0.6s ease both 0.25s; }
.hero-social { animation: fadeUp 0.6s ease both 0.35s; }
.hero-cv     { animation: fadeUp 0.6s ease both 0.45s; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  nav { padding: 1rem 1.25rem; }
  .nav-links { gap: 1.25rem; }
  section { padding: 4rem 1.25rem; }
  #hero { padding-top: 5.5rem; }
}