:root {
  --bg: #ffffff;
  --bg-tint: #f6f4ff;
  --ink: #16121f;
  --muted: #6b6580;
  --violet: #7c3aed;
  --violet-2: #a855f7;
  --violet-soft: #ede9fe;
  --border: #ece8f5;
  --shadow: 0 20px 45px rgba(91, 33, 182, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

#scroll-root {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

#scroll-root::-webkit-scrollbar {
  display: none;
}

.panel {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 5rem 2rem 3rem;
  scroll-snap-align: start;
  overflow-y: auto;
}

/* ---------- Brand ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.8rem;
  color: #fff;
  transition: color 0.3s ease;
}

.topbar.brand-dark {
  color: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.topnav-link:hover {
  opacity: 1;
}

@media (max-width: 600px) {
  .topnav-link span {
    display: none;
  }
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
}

/* ---------- Eyebrow badge ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.2rem;
  padding: 0.4rem 0.9rem;
  background: #fff3d6;
  color: #b97e07;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5a623;
}

.grad {
  background: linear-gradient(120deg, var(--violet), var(--violet-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Hero (centre) ---------- */
.panel-hero {
  background: #fefefe;
}

.hero {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 2.5rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-underline {
  display: block;
  width: 64px;
  height: 5px;
  border-radius: 999px;
  margin: 1.1rem 0 1.4rem;
  background: linear-gradient(120deg, var(--violet), var(--violet-2));
}

.hero-sub {
  max-width: 30rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-sub strong {
  color: var(--ink);
}

.hero-image img {
  width: 100%;
  max-width: 520px;
  justify-self: end;
  display: block;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 2rem 0 2.2rem;
}

button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-weight: 600;
  border-radius: 14px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
}

.btn-icon {
  display: inline-flex;
}

.btn-primary {
  background: linear-gradient(120deg, var(--violet), var(--violet-2));
  color: #fff;
  border: none;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.35);
}

.btn-ghost {
  background: linear-gradient(120deg, #f7b21b, #f5a623);
  color: #5a2a00;
  border: none;
  box-shadow: 0 12px 24px rgba(245, 166, 35, 0.35);
}

/* ---------- Feature row ---------- */
.features {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.feature {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.feature svg {
  color: var(--violet);
}

.feature-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}

/* ---------- Sections projets ---------- */
.panel-light {
  background: var(--bg);
}

.panel-projects {
  color: #fff;
}

.theme-violet {
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --accent-soft: #ede9fe;
  background: radial-gradient(
      circle at 50% 118%,
      #b266ff 0%,
      rgba(178, 102, 255, 0.55) 32%,
      rgba(178, 102, 255, 0) 60%
    ),
    radial-gradient(circle at 50% -12%, #8b46e6 0%, #6d28d9 52%, #4c1d95 100%);
}

.theme-orange {
  --accent: #e5318b;
  --accent-2: #f5a623;
  --accent-soft: #fdecf4;
  background: radial-gradient(
      circle at 50% 118%,
      #f7b21b 0%,
      rgba(247, 178, 27, 0.65) 32%,
      rgba(247, 178, 27, 0) 58%
    ),
    radial-gradient(circle at 50% -12%, #e5318b 0%, #9c1f5e 55%, #5e123a 100%);
}

.section-inner {
  width: min(100%, 1280px);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.6s ease;
}

.section-head-center {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.panel-projects .section-head h2 {
  color: #fff;
}

.panel-projects .section-sub {
  color: rgba(255, 255, 255, 0.72);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Filtres ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 2rem;
}

.filter {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  font-weight: 600;
}

.filter:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: none;
}

.filter.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

/* Section Design : actif en jaune, inactifs en blanc transparent */
.theme-orange .filter {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.theme-orange .filter:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

.theme-orange .filter.active {
  background: linear-gradient(120deg, #f7a81b, #f5b91b);
  border-color: transparent;
  color: #5a2a00;
}

/* Section Data : filtre sélectionné en blanc plein */
.theme-violet .filter.active {
  background: #ffffff;
  border-color: transparent;
  color: #6d28d9;
}

/* ---------- Cartes projets ---------- */
.cards {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

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

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.pcard {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.pcard-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  order: 1;
}

.ptags {
  order: 2;
}

.pcard p {
  order: 3;
}

.pcard-foot {
  order: 4;
}

.pcard-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pcard-head h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.pcard-org {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.pcard p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.ptags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  margin-top: auto;
}

.ptags span {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.theme-orange .pcard-icon {
  background: rgba(245, 166, 35, 0.16);
  color: #e0950a;
}

/* Couleurs des tags d'outils */
.ptags .tag-rose {
  background: #fde4ef;
  color: #d6337a;
}

.ptags .tag-jaune {
  background: #fcebc4;
  color: #98660a;
}

.ptags .tag-violet {
  background: #ece9fe;
  color: #7c3aed;
}

.ptags .tag-gris {
  background: #eceaf1;
  color: #4b4658;
}

.ptags .tag-noir {
  background: #211c30;
  color: #ffffff;
}

.pcard-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  gap: 0.6rem;
}

.card-note {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

#designer .section-inner,
#data .section-inner {
  transform: translateY(24px);
  opacity: 0;
}

#designer.in-view .section-inner,
#data.in-view .section-inner {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .section-inner {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 3.5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.section-sub strong {
  color: var(--ink);
}

.projects {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 55px rgba(91, 33, 182, 0.18);
}

.project-cat {
  margin: 0 0 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet);
}

.project h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  line-height: 1.25;
}

.project p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags span {
  background: var(--violet-soft);
  color: var(--violet);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.stack {
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-label {
  display: inline-block;
  margin-right: 0.6rem;
  padding: 0.2rem 0.6rem;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  /* Navigation horizontale : flèches haut/bas -> gauche/droite */
  .btn-icon svg {
    transform: rotate(-90deg);
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 320px;
    justify-self: center;
    margin: 0 auto;
  }
}
