/* =========================================================
   Portfolio — Alvin (Grynds)
   Style inspiré de l'esthétique Apple : clair, épuré, aéré.
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7; /* gris Apple */
  --bg-dark: #0b0b0c;
  --text: #1d1d1f; /* presque noir Apple */
  --text-soft: #6e6e73; /* gris secondaire */
  --accent: #0071e3; /* bleu Apple */
  --accent-h: #0077ed;
  --border: #d2d2d7;
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 980px;
  --nav-h: 48px;
  --font:
    "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}
strong {
  font-weight: 600;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Navigation (barre dépolie type Apple) ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.3s ease;
}
.nav__inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  gap: 28px;
}
.nav__links a {
  font-size: 13px;
  color: var(--text);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.nav__links a:hover {
  opacity: 1;
  color: var(--accent);
}
.nav__cta {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 7px 15px;
  border-radius: 980px;
  transition: background 0.2s ease;
}
.nav__cta:hover {
  background: var(--accent-h);
}

/* Burger mobile */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
.nav__burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__burger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-size: 16px;
  font-weight: 400;
  padding: 11px 22px;
  border-radius: 980px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-h);
}
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--text);
}
.btn--link {
  color: var(--accent);
  padding: 11px 6px;
}
.btn--link:hover {
  text-decoration: underline;
}
.btn--small {
  font-size: 14px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
}
.btn--small:hover {
  background: var(--accent-h);
}
.btn--disabled {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  cursor: default;
}
.btn--disabled:hover {
  transform: none;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 22px 80px;
  background: radial-gradient(
    120% 90% at 50% 0%,
    #fbfbfd 0%,
    #f0f2f5 60%,
    #e9edf2 100%
  );
}
.hero__content {
  max-width: 820px;
}
.hero__eyebrow {
  color: var(--accent);
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero__subtitle {
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--text-soft);
  margin: 22px auto 0;
  max-width: 620px;
}
.hero__actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Sections génériques ---------- */
.section {
  padding: 110px 0;
}
.section--light {
  background: var(--bg-alt);
}
.section__eyebrow {
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  margin-bottom: 10px;
}
.section__title {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 40px;
}

/* ---------- À propos ---------- */
.about__text {
  max-width: 720px;
}
.about__text p {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--text-soft);
  margin-bottom: 18px;
}
.about__text strong {
  color: var(--text);
}

/* ---------- Compétences ---------- */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.skill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.section--light .skill {
  background: #fff;
}
.skill:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
.skill__name {
  font-size: 18px;
  font-weight: 600;
}
.skill__level {
  font-size: 13px;
  color: var(--text-soft);
}
.skill[data-level="solide"] .skill__level {
  color: #1a7f37;
}
.skill[data-level="progress"] .skill__level {
  color: var(--accent);
}
.skill[data-level="base"] .skill__level {
  color: #8a5a00;
}

.skills__soft {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.skills__soft li {
  font-size: 14px;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 980px;
}
.section:not(.section--light) .skills__soft li {
  background: var(--bg-alt);
}

/* ---------- Projets ---------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.project {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.project:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1);
}

.project__media,
.project__media1 {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e8ebf0 0%, #f5f5f7 100%);
}

.project__media img {
  max-width: 60%;
  max-height: 70%;
  object-fit: contain;
}

.project__media1 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.project__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project__desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.55;
}
.project__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.project__tags li {
  font-size: 12px;
  color: var(--text);
  background: var(--bg-alt);
  padding: 4px 11px;
  border-radius: 980px;
}
.project__role {
  font-size: 14px;
  color: var(--text-soft);
}
.project__role strong {
  color: var(--text);
}
.project__links {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Services ---------- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.service {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
}
.service h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
}
.service p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.55;
}

/* ---------- Parcours (timeline) ---------- */
.timeline {
  list-style: none;
  max-width: 720px;
  border-left: 2px solid var(--border);
}
.timeline__item {
  position: relative;
  padding: 0 0 34px 28px;
}
.timeline__item:last-child {
  padding-bottom: 0;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
.timeline__item h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline__item p {
  font-size: 15px;
  color: var(--text-soft);
}

/* ---------- Contact ---------- */
.section--contact {
  background: var(--bg-alt);
  text-align: center;
}
.section--contact .section__title {
  margin-bottom: 18px;
}
.contact__lead {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto 32px;
}
.contact__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.contact__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: left;
}
.contact__list li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.contact__list span {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.contact__list a,
.contact__list p {
  font-size: 17px;
  font-weight: 500;
}
.contact__list a:hover {
  color: var(--accent);
}
.contact__social {
  list-style: none;
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact__social a {
  font-size: 15px;
  color: var(--text-soft);
  transition: color 0.2s ease;
}
.contact__social a:hover {
  color: var(--accent);
}

/* ---------- Groupes de compétences ---------- */
.skills__group {
  margin-bottom: 34px;
}
.skills__group h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

/* ---------- Formulaire de contact ---------- */
.form {
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.form__row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form label {
  font-size: 14px;
  font-weight: 500;
}
.form input,
.form textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg);
  resize: vertical;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
.form .btn {
  border: 0;
  width: 100%;
}
.form__status {
  min-height: 20px;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.form__status.is-error {
  color: #c62828;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-dark);
  color: #86868b;
  text-align: center;
  padding: 30px 22px;
  font-size: 13px;
}

/* ---------- Animations d'apparition au scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    padding: 12px 0;
  }
  .nav__links.is-open {
    transform: translateY(0);
  }
  .nav__links a {
    padding: 14px 24px;
    font-size: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  .nav__cta {
    display: none;
  }
  .nav__burger {
    display: flex;
  }

  .section {
    padding: 80px 0;
  }
  .hero {
    min-height: 88vh;
    padding-top: 110px;
  }
}

/* ---------- Respect des préférences d'accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    transition: none !important;
  }
}
