/* ============================================================
   Cyrian NOMENJANAHARY — Portfolio
   Design minimaliste : bleu, gris argenté, blanc
   ============================================================ */

@font-face {
  font-family: "Lexend";
  src: url("/assets/Lexend-Variable.woff2") format("woff2-variations"),
    url("/assets/Lexend-VariableFont_wght_iOPj7B4mTpb_5B0I9HeRu.ttf")
      format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eef2f7;
  --ink: #0d1b2a;
  --body: #46566b;
  --muted: #8494a8;
  --line: #e2e8f0;
  --blue: #1d63ea;
  --blue-dark: #144bb8;
  --blue-soft: #eaf1fe;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(13, 27, 42, 0.16);
  --container: 72rem;
  --header-h: 4.5rem;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

h1 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p {
  margin: 0 0 1em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--blue-dark);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--blue-soft);
  color: var(--ink);
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  width: auto;
  height: 2.6rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
}

.site-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--blue);
}

.site-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: background-color 0.15s ease;
}

.nav-toggle:hover {
  background: var(--surface);
}

.nav-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 47.9rem) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem clamp(1.25rem, 4vw, 2rem) 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--line);
  }

  .site-nav .btn {
    margin-top: 1rem;
    border-bottom: 0;
    justify-content: center;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--blue);
}

.link-arrow svg {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 0.2s ease;
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section-alt {
  background: var(--surface);
}

.kicker {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.section-intro {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-intro p {
  color: var(--body);
  margin-bottom: 0;
}

.accent {
  color: var(--blue);
}

/* ---------- Hero (accueil / à propos) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(42rem 26rem at 85% -10%, var(--blue-soft), transparent 65%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.hero-copy .kicker {
  margin-bottom: 1.2rem;
}

.hero-copy h1 {
  margin-bottom: 0.6rem;
}

.hero-lead {
  max-width: 34rem;
  font-size: 1.05rem;
  margin-block: 1.2rem 1.8rem;
}

.hero-photo {
  position: relative;
  justify-self: center;
  max-width: 26rem;
  width: 100%;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 8% 4% 0;
  background: linear-gradient(160deg, var(--blue-soft) 0%, var(--surface-2) 100%);
  border-radius: 2rem;
}

.hero-photo img {
  position: relative;
  width: 100%;
  border-radius: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.6rem;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--body);
}

.hero-links a:hover {
  color: var(--blue);
}

.hero-links svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted);
}

/* Rotation des métiers */

.roles {
  position: relative;
  height: 1.9em;
  overflow: hidden;
  font-size: clamp(1.15rem, 1rem + 1.2vw, 1.6rem);
  font-weight: 500;
  color: var(--blue);
}

.roles ul {
  margin: 0;
  padding: 0;
  list-style: none;
  animation: roles-cycle 9s infinite;
}

.roles li {
  height: 1.9em;
  display: flex;
  align-items: center;
}

@keyframes roles-cycle {
  0%, 28% { transform: translateY(0); }
  33%, 61% { transform: translateY(-1.9em); }
  66%, 94% { transform: translateY(-3.8em); }
  100% { transform: translateY(0); }
}

@media (max-width: 47.9rem) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
    max-width: 17rem;
  }
}

/* ---------- Cartes projets ---------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease,
    border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #cdd9ea;
  box-shadow: var(--shadow-md);
}

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
  padding: 1.25rem 1.4rem 1.5rem;
}

.card-body h2,
.card-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.card-tag {
  font-size: 0.85rem;
  color: var(--muted);
}

.card-body .link-arrow {
  margin-top: auto;
  padding-top: 0.9rem;
  font-size: 0.92rem;
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(2rem, 5vw, 3rem);
}

/* ---------- Services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.service {
  padding: 1.75rem 1.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.service:hover {
  transform: translateY(-4px);
  border-color: #cdd9ea;
  box-shadow: var(--shadow-md);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
}

.service-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.service h2 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.service p {
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- À propos ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.badges a {
  display: inline-flex;
}

.badges img {
  height: 4.5rem;
  width: auto;
  transition: transform 0.2s ease;
}

.badges a:hover img {
  transform: translateY(-3px);
}

.badge-note {
  font-size: 0.8rem;
  color: var(--muted);
}

.tabs {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem;
  width: fit-content;
  background: var(--surface-2);
  border-radius: 999px;
}

.tablist [role="tab"] {
  padding: 0.55rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tablist [role="tab"]:hover {
  color: var(--ink);
}

.tablist [role="tab"][aria-selected="true"] {
  background: var(--bg);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.tabpanel {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.tabpanel[hidden] {
  display: none;
}

.timeline {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.timeline h3 {
  margin: 0;
  font-size: 1.05rem;
}

.timeline .org {
  grid-column: 1;
  font-size: 0.92rem;
  color: var(--body);
}

.timeline .period {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-list li {
  padding: 0.5rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Étude de cas ---------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}

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

.breadcrumb a:hover {
  color: var(--blue);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--line);
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

.case-hero {
  background:
    radial-gradient(40rem 22rem at 90% -20%, var(--blue-soft), transparent 60%),
    var(--bg);
  padding-block: clamp(2.5rem, 6vw, 4rem) 0;
}

.case-hero h1 {
  max-width: 52rem;
}

.case-hero .cover {
  margin-top: clamp(2rem, 5vw, 3rem);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.case-hero .cover img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.case-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.overview-block {
  padding: 1.6rem 1.6rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.overview-block h2 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.overview-block :last-child {
  margin-bottom: 0;
}

.case-section {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}

.case-section:first-of-type {
  border-top: 0;
}

.case-body {
  max-width: 50rem;
}

.case-body ul {
  padding-left: 1.2rem;
  margin: 0 0 1.2em;
}

.case-body li {
  margin-bottom: 0.45em;
}

.case-body li::marker {
  color: var(--blue);
}

.case-body dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.9em;
}

.case-body dd {
  margin: 0.15em 0 0;
}

.case-body figure {
  margin: 1.75rem 0;
}

.case-body figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.case-body figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.case-body h3 {
  margin-top: 2.2rem;
}

.case-body h4 {
  margin-top: 1.6rem;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}

/* ---------- Prose (privacy) ---------- */

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li::marker {
  color: var(--blue);
}

.page-head {
  padding-block: clamp(3rem, 7vw, 5rem) 0;
}

.page-head .section-intro {
  margin-bottom: 0;
}

/* ---------- Dialog contact ---------- */

.contact-dialog {
  width: min(26rem, calc(100vw - 2.5rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overscroll-behavior: contain;
}

.contact-dialog::backdrop {
  background: rgba(13, 27, 42, 0.45);
  backdrop-filter: blur(3px);
}

.contact-inner {
  padding: 1.75rem 1.75rem 2rem;
}

.contact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.contact-head h2 {
  font-size: 1.3rem;
  margin: 0;
}

.contact-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.contact-close:hover {
  background: var(--surface);
  color: var(--ink);
}

.contact-close svg {
  width: 1rem;
  height: 1rem;
}

.contact-sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.contact-list {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.contact-list .ico {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
}

.contact-list .ico svg {
  width: 1.15rem;
  height: 1.15rem;
}

.contact-list .lbl {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.contact-list a,
.contact-list .val {
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.contact-list a:hover {
  color: var(--blue);
}

.contact-qr {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.contact-qr img {
  width: 6rem;
  height: 6rem;
  border-radius: 8px;
}

.contact-qr p {
  margin: 0;
  font-size: 0.88rem;
}

.contact-qr strong {
  display: block;
  color: var(--ink);
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 46rem;
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.75rem;
  transition: color 0.15s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--blue);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item summary:hover {
  color: var(--blue);
}

.faq-item p {
  padding: 0 1.25rem 1.1rem;
  margin: 0;
  font-size: 0.95rem;
}

.service h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.service .link-arrow {
  margin-top: 0.9rem;
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 2.5rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-social a,
.site-footer .legal a {
  font-size: 0.9rem;
  color: var(--body);
}

.footer-social a:hover,
.site-footer .legal a:hover {
  color: var(--blue);
}

.site-footer .legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Divers ---------- */

.certif-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .roles ul {
    animation: none;
  }
}
