/* --- Variables & Reset --- */
:root {
  --dark: #0f1e2a;
  --mid: #1a2f3f;
  --accent: #00bcd4;
  --accent-soft: rgba(0, 188, 212, 0.12);
  --text: #1e3444;
  --text-muted: #5a7282;
  --bg: #ffffff;
  --surface: #f5fafc;
  --border: #ddeaf0;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

main {
  flex: 1;
}

/* --- Navigation --- */
nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  background: var(--dark);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav a {
  font-weight: bold;
  color: #7ab8cc;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.82em;
  transition: color 0.3s;
  position: relative;
  padding-bottom: 4px;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--accent);
}

nav a:hover::after {
  width: 100%;
}

/* --- Hero Header --- */
header {
  background: var(--dark);
  padding: 120px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 188, 212, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(0, 188, 212, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

header h1 {
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  position: relative;
  line-height: 1.2;
}

header p {
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.3px;
  position: relative;
  font-weight: 400;
}

/* --- Sections --- */
section {
  padding: 96px 24px;
  max-width: 1200px;
  margin: auto;
}

section h2 {
  text-align: center;
  margin-bottom: 56px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.3px;
}

section h2::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* --- À propos --- */
#about p {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 640px;
  margin: auto;
  line-height: 1.9;
}

#about a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

#about a:hover {
  border-bottom-color: var(--accent);
}

/* --- Technologies --- */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 96px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tech-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 188, 212, 0.12);
  transform: translateY(-2px);
}

.tech-item span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* --- Portfolio --- */
#portfolio {
  max-width: 100%;
  padding: 96px 40px;
  background: var(--surface);
}

#portfolio h2 {
  color: var(--dark);
}

.portfolio {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  justify-content: center;
}

.portfolio > article {
  flex: 1 1 300px;
  max-width: 420px;
  display: flex;
}

.project {
  background: var(--bg);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  color: inherit;
  width: 100%;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.project h3 {
  color: var(--dark);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.project p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

.project-image {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  width: 100%;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 42, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.project:hover .project-overlay {
  opacity: 1;
}

.project:hover .project-image img {
  transform: scale(1.04);
}

/* --- Contact --- */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin: auto;
}

form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: -6px;
}

form input,
form textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

form button {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--dark);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  font-family: inherit;
  margin-top: 4px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

form button:hover {
  background: var(--mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.2);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 28px 24px;
  background: var(--dark);
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  margin-top: auto;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: #b0ccd8;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  header {
    padding: 80px 20px 70px;
    min-height: 280px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  section {
    padding: 64px 20px;
  }

  #portfolio {
    padding: 64px 20px;
  }

  nav {
    gap: 0;
    padding: 0 8px;
  }

  nav a {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .tech-item {
    width: 80px;
    padding: 16px 10px;
  }

  .tech-item img {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  nav a {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .tech-grid {
    gap: 10px;
  }

  .tech-item {
    width: 72px;
    padding: 14px 8px;
  }

  .tech-item img {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 320px) {
  nav a {
    font-size: 0.62rem;
    padding: 4px 6px;
  }
}
