/* ============================================
   PORTFOLIO - Rafael Borreill
   ============================================ */

:root {
  --bg: #f4f6f8;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.12);
  --nav-height: 65px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ============ NAVIGATION ============ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ============ PAGE ============ */

.page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

/* ============ HERO ============ */

.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: 650px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hero h1 span {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.hero-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ BOUTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: #eff6ff;
}

/* ============ SECTIONS ============ */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.section-title span {
  color: var(--accent);
}

.section-line {
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 2rem;
}

/* ============ STATS ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

/* ============ TIMELINE ============ */

.timeline {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
}

.timeline-sub {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* ============ COMPÉTENCES ============ */

.skills-block {
  margin-bottom: 1.5rem;
}

.skills-block h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

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

.skill-tag {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  font-size: 0.83rem;
  box-shadow: var(--shadow);
}

/* ============ PROJETS ============ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

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

.project-icon {
  font-size: 1.75rem;
}

.project-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.project-short {
  font-size: 0.88rem;
  color: var(--text-light);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.project-tag {
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.project-more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ============ MODAL ============ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-title-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-icon {
  font-size: 1.75rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
  white-space: pre-line;
}

.modal-details {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-light);
}

.modal-details strong {
  color: var(--text);
}

/* ============ CV ============ */

.cv-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.cv-download-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.cv-download-box p {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.cv-section {
  margin-bottom: 2.5rem;
}

.cv-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-entry {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cv-entry-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.cv-entry-date {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.cv-entry-sub {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

/* ============ CONTACT ============ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.contact-item:hover {
  border-color: var(--accent);
}

.contact-item-icon {
  font-size: 1.3rem;
  width: 36px;
  text-align: center;
}

.contact-item-label {
  font-size: 0.72rem;
  color: var(--text-light);
}

.contact-item-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============ FOOTER ============ */

footer {
  border-top: 1px solid var(--border);
  background: var(--white);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-light);
}

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

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
}
