/*
  Abdelnaim.fr — refactor
  - structure claire : base → layout → composants → sections
  - thème piloté par variables CSS (accent/gradients par section)
*/

:root {
  --bg: #09090b;
  --fg: #e5e7eb;
  --muted: rgba(229, 231, 235, 0.72);
  --muted-2: rgba(229, 231, 235, 0.55);

  --border: rgba(255, 255, 255, 0.12);
  --border-2: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.06);
  --card-2: rgba(0, 0, 0, 0.24);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);

  /* Valeurs par défaut, remplacées dynamiquement via JS / section active */
  --accent: #a78bfa;
  --accentHover: #7c3aed;
  --accentSoft: rgba(167, 139, 250, .22);

  --topbar-h: 72px;
  --container-pad: clamp(18px, 3.2vw, 46px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

a { color: inherit; }

/* --- Accessibilité --- */

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border);
  transform: translateY(-140%);
  transition: transform .2s ease;
  z-index: 2000;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Topbar --- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-pad);
  z-index: 1200;
  margin: 10px;
  border-radius: 10px;

  background: linear-gradient(180deg, rgba(9, 9, 11, 0.78), rgba(9, 9, 11, 0.35));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__text {
  font-weight: 700;
  letter-spacing: .04em;
  opacity: .95;
}

.topbar__actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* --- Boutons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
  letter-spacing: .02em;

  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  will-change: transform;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}


.btn[aria-disabled="true"] {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: none;
  filter: saturate(0.9);
}
.btn--primary {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.14);
  color: #0b0b0f;
  box-shadow: 0 14px 38px var(--accentSoft);
}

.btn--primary:hover {
  background: var(--accentHover);
  transform: translateY(-1px);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* --- Navigation par points (desktop) --- */

.dots {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 10px;
  z-index: 1100;
}

.dots__btn {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}

.dots__btn:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.36);
}

.dots__btn[aria-current="true"] {
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 6px var(--accentSoft);
}

/* --- Carrousel / scroll-snap --- */

.carousel {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;

  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 8px);
}

.section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;

  padding: calc(var(--topbar-h) + 34px) var(--container-pad) 38px;
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  isolation: isolate;

  background:
    radial-gradient(850px 420px at 18% 18%, var(--accentSoft), transparent 55%),
    radial-gradient(700px 420px at 82% 72%, rgba(255, 255, 255, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg1, #09090b), var(--bg2, #09090b));
}

.section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 50%, black 0, transparent 62%);
  z-index: -1;
}

.section__inner {
  width: min(1120px, 100%);
}

.section__inner--split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.section__inner--project {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

/* --- Typo --- */

.kicker {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

.h1 {
  margin: 14px 0 12px;
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}

.h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.55vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}

.text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.muted { color: var(--muted); }

.center { text-align: center; }
.max { max-width: 62ch; margin-left: auto; margin-right: auto; }

/* --- Composants --- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cta-row.center { justify-content: center; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-2);
  font-weight: 650;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card--soft {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}

.card--glow {
  position: relative;
  overflow: hidden;
}

.card--glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(420px 240px at 18% 18%, var(--accentSoft), transparent 60%);
  z-index: -1;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-2);
  padding: 12px;
}

.mini__title { font-weight: 750; margin-bottom: 6px; }
.mini__text { color: var(--muted-2); line-height: 1.5; font-size: 14px; }

.bullets {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.bullets--compact { margin-top: 10px; }

/* --- HERO --- */

.section--hero .h1 {
  color: rgba(255, 255, 255, 0.97);
}

.hint {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: .85;
}

.hint__pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  font-size: 13px;
}

.hint__arrow {
  font-size: 18px;
  animation: bob 1.7s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* --- Projets --- */

.project__media {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.project__media img {
  display: block;
  width: 100%;
  height: auto;
}

.project__content {
  display: grid;
  gap: 12px;
}

.project__head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.project__logo {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

/* Only for Benoit Pierre logo: no frame/border */
.project__logo--plain {
  border: 0;
  background: transparent;
}

/* --- Logo animation (counter-clockwise) --- */

@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.project__logo--spin {
  animation: spin-ccw 7s linear infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .project__logo--spin { animation: none; }
}

.quote {
  margin: 0;
  font-weight: 650;
  line-height: 1.6;
}

/* --- Skills --- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

/* --- Contact --- */

.contact-card {
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  padding: 18px;
  width: min(620px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.contact-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-card__row:last-child {
  border-bottom: 0;
}

.contact-card__label {
  color: var(--muted-2);
  font-weight: 650;
}

.contact-card__value {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  text-decoration: none;
}

.contact-card__value:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 14px;
}

/* --- Scrollbar (WebKit) --- */

.carousel::-webkit-scrollbar { width: 10px; }
.carousel::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
.carousel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), rgba(0, 0, 0, 0.25));
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.35);
}
.carousel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accentHover), rgba(0, 0, 0, 0.25));
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .section__inner--split,
  .section__inner--project {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dots { display: none; }

  .topbar {
    padding: 0 14px;
  }

  .brand__text { display: none; }
}

@media (max-width: 520px) {
  :root { --topbar-h: 66px; }

  .btn { padding: 10px 12px; }

  .cards { grid-template-columns: 1fr; }

  .contact-card__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel { scroll-behavior: auto; }
  .hint__arrow { animation: none; }
  .btn { transition: none; }
}
