/* PHNX Profils — amélioration fidèle au thème historique */

:root {
  --phnx-bg: #0d0f13;
  --phnx-panel: #15181e;
  --phnx-panel-hover: #1a1e26;
  --phnx-line: #2a2f38;
  --phnx-text: #f0f2f5;
  --phnx-muted: #a1a8b6;
  --phnx-red: #ee5261;
  --phnx-red-soft: #ff9aa8;
  --phnx-ease: cubic-bezier(.23, 1, .32, 1);
  color-scheme: dark;
}

html { background: var(--phnx-bg); scrollbar-gutter: stable; }
body { min-width: 0; overflow-x: clip; background: var(--phnx-bg); }
img, svg { max-width: 100%; }
.site-header { isolation: isolate; }
.brand-mark { overflow: hidden; background: #15181e; border: 1px solid #353b46; box-shadow: none; }
.brand-mark img { display: block; width: 100%; height: 100%; }

.site-header nav a,
.workspace-rail > a,
.filter,
.directory-search button,
.pagination a,
.row-open,
.hero-project-link,
.project-cta {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 120ms var(--phnx-ease);
}

.site-header nav a[aria-current="page"] { color: #fff; background: #20232b; }
.hero-project-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 17px; color: #d8dde6; text-decoration: none; font-size: 12px; font-weight: 650; }
.hero-project-link span { color: var(--phnx-red); }
.dashboard-metrics article { min-width: 0; }
.dashboard-metrics strong { overflow-wrap: anywhere; }
.directory-search > div:focus-within { border-color: rgba(238, 82, 97, .72); box-shadow: 0 0 0 3px rgba(238, 82, 97, .11); }
.directory-search input { width: 100%; }
.directory-search button, .pagination a { display: inline-grid; place-items: center; text-decoration: none; }
.pagination a { min-height: 37px; padding: 0 15px; border: 1px solid var(--phnx-line); border-radius: 8px; background: #181c24; color: #d9dee7; font-size: 11px; font-weight: 600; }
.pagination a[aria-disabled="true"], .pagination a.disabled { opacity: .38; pointer-events: none; }
.dossier-row.profile-card, .dashboard-metrics article, .profile-panel { transition: background-color 180ms ease, border-color 180ms ease; }
.row-open { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 36px; }
footer nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 14px; }
footer nav a { color: #aeb7c5; text-decoration: none; }

/* Page projet : le même langage visuel sobre que le tableau de bord. */
.project-page { background: var(--phnx-bg); color: var(--phnx-text); }
.project-main { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 54px 0 72px; }
.project-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .55fr); gap: clamp(28px, 6vw, 76px); align-items: center; padding-bottom: 50px; border-bottom: 1px solid var(--phnx-line); }
.project-eyebrow { margin: 0 0 10px; color: var(--phnx-red); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.project-hero h1, .project-section-heading h2, .project-trust h2, .project-final h2 { margin: 0; letter-spacing: -.035em; text-wrap: balance; }
.project-hero h1 { max-width: 740px; font-size: clamp(34px, 5.5vw, 64px); line-height: 1.04; }
.project-lead { max-width: 720px; margin: 20px 0 0; color: var(--phnx-muted); font-size: clamp(14px, 1.5vw, 17px); line-height: 1.75; }
.project-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 27px; }
.project-cta { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #373e49; border-radius: 8px; padding: 0 16px; background: #191d24; color: #e7eaf0; text-decoration: none; font-size: 12px; font-weight: 700; }
.project-cta.primary { border-color: #d94555; background: #d94555; color: #fff; }
.project-identity { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--phnx-line); border-radius: 12px; padding: 22px; background: var(--phnx-panel); }
.project-icon { width: 52px; height: 52px; overflow: hidden; border: 1px solid #393f4a; border-radius: 13px; }
.project-icon img { width: 100%; height: 100%; }
.project-identity strong { margin-top: 28px; font-size: clamp(35px, 5vw, 55px); line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.project-identity > span:last-child { margin-top: 8px; color: var(--phnx-muted); font-size: 11px; line-height: 1.5; }
.project-principles, .project-method, .project-trust, .project-final { padding: 54px 0; border-bottom: 1px solid var(--phnx-line); }
.project-section-heading { max-width: 730px; }
.project-section-heading h2, .project-trust h2, .project-final h2 { font-size: clamp(27px, 4vw, 42px); line-height: 1.12; }
.project-section-heading > p:last-child { margin: 16px 0 0; color: var(--phnx-muted); line-height: 1.7; }
.project-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 29px; }
.project-card-grid article { min-width: 0; border: 1px solid var(--phnx-line); border-radius: 11px; padding: 22px; background: var(--phnx-panel); }
.project-number { color: var(--phnx-red-soft); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.project-card-grid h3, .project-timeline h3 { margin: 15px 0 8px; font-size: 17px; }
.project-card-grid p, .project-timeline p, .project-trust-copy p { margin: 0; color: var(--phnx-muted); font-size: 13px; line-height: 1.7; }
.project-timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 30px 0 0; padding: 0; list-style: none; }
.project-timeline li { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 22px 0; border-top: 1px solid var(--phnx-line); }
.project-timeline li > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #73434d; border-radius: 8px; color: #ffb5c0; background: #302128; font-size: 11px; font-weight: 750; }
.project-timeline h3 { margin-top: 3px; }
.project-trust { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 72px); }
.project-trust-copy { display: grid; gap: 17px; }
.project-final { border-bottom: 0; text-align: center; }
.project-final .project-cta { margin-top: 24px; }

@media (hover: hover) and (pointer: fine) {
  .site-header nav a:hover, .workspace-rail > a:hover { color: #fff; background: #20232b; }
  .hero-project-link:hover, footer nav a:hover { color: #fff; }
  .filter:hover { background: #302128; color: #ffb5c0; border-color: #78434f; }
  .dossier-row.profile-card:hover { background: var(--phnx-panel-hover); }
  .project-cta:hover, .pagination a:hover { border-color: #515967; background: #20252d; color: #fff; }
  .project-cta.primary:hover { border-color: #ec5b6b; background: #ec5b6b; }
}

.site-header nav a:active, .workspace-rail > a:active, .filter:active, .directory-search button:active, .pagination a:active, .hero-project-link:active, .project-cta:active { transform: scale(.97); }

@media (max-width: 960px) {
  .project-main { width: min(100% - 40px, 820px); padding-top: 42px; }
  .project-hero { grid-template-columns: minmax(0, 1fr) 220px; gap: 30px; }
  .project-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { height: auto; min-height: 62px; flex-wrap: wrap; gap: 0; padding: 9px 16px 8px; }
  .brand { min-height: 44px; }
  .site-header nav { order: 2; width: 100%; display: flex; flex-wrap: nowrap !important; gap: 3px; overflow-x: auto; padding: 5px 0 0; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { display: inline-flex; flex: 0 0 auto; min-height: 36px; align-items: center; padding: 7px 10px; font-size: 10px; white-space: nowrap; }
  .site-header nav a:first-child { display: none; }
  .directory-view, .profile-view { padding-top: 26px; }
  .hero { padding-bottom: 23px; }
  .hero h1 { max-width: 18ch; font-size: clamp(27px, 9vw, 34px); line-height: 1.08; }
  .hero-copy { max-width: 58ch; font-size: 13px; }
  .dashboard-metrics strong { font-size: clamp(23px, 8vw, 28px); }
  .filters { flex-wrap: nowrap; width: calc(100vw - 32px); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; }
  .row-open { min-width: 54px; }
  footer { align-items: flex-start; }
  footer nav { justify-content: flex-start; }
  .project-main { width: calc(100% - 32px); padding: 34px 0 50px; }
  .project-hero, .project-trust { grid-template-columns: 1fr; }
  .project-hero { gap: 28px; padding-bottom: 38px; }
  .project-identity { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 17px; }
  .project-icon { width: 46px; height: 46px; grid-row: 1 / 3; }
  .project-identity strong { margin: 0; font-size: 32px; }
  .project-identity > span:last-child { margin: 0; }
  .project-principles, .project-method, .project-trust, .project-final { padding: 40px 0; }
  .project-timeline { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand > span:last-child { gap: 4px; }
  .brand strong { font-size: 16px; }
  .brand b { font-size: 8px; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-metrics article:first-child { grid-column: 1 / -1; }
  .dashboard-metrics article { padding: 13px; }
  .directory-search > div { grid-template-columns: 34px minmax(0, 1fr); }
  .directory-search button { width: 100%; }
  .project-actions .project-cta { width: 100%; }
  .project-card-grid article { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-contrast: more) {
  .site-header, .dashboard-metrics article, .dossier-row.profile-card, .profile-panel, .project-card-grid article, .project-identity { border-color: #626a78; }
}

/* PHNX DASHBOARD REF FIX */

.phnx-ref-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0 16px}
.phnx-ref-toolbar-copy{display:grid;gap:3px}
.phnx-ref-toolbar-copy strong{font-size:15px;color:#f4f7fb}
.phnx-ref-toolbar-copy span{font-size:11px;color:#748195}
.phnx-ref-periods{display:flex;gap:4px;padding:4px;border:1px solid #273140;background:#0b1119;border-radius:12px}
.phnx-ref-periods button{border:0;background:transparent;color:#7f8ca0;font:800 11px/1 system-ui;padding:8px 12px;border-radius:8px;cursor:pointer}
.phnx-ref-periods button:hover{color:#e7edf6;background:#171f2b}
.phnx-ref-periods button.active{background:#dcefff;color:#0b1320;box-shadow:0 3px 14px rgba(0,0,0,.2)}
.dashboard-metrics.phnx-ref-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important;margin:0 0 30px!important}
.dashboard-metrics.phnx-ref-grid>article{--accent:#ff5c6d;--accent-rgb:255,92,109;position:relative;min-width:0!important;min-height:305px!important;padding:22px 20px 16px!important;overflow:hidden!important;border:1px solid #253141!important;border-radius:20px!important;background:radial-gradient(circle at 12% 0%,rgba(var(--accent-rgb),.07),transparent 30%),linear-gradient(180deg,#101722 0%,#0b121c 100%)!important;box-shadow:0 10px 28px rgba(0,0,0,.18)!important;display:flex!important;flex-direction:column!important;gap:0!important;transform:none!important}
.dashboard-metrics.phnx-ref-grid>article:first-child{border-color:rgba(255,92,109,.38)!important;background:radial-gradient(circle at 12% 0%,rgba(255,92,109,.11),transparent 31%),linear-gradient(180deg,#121722 0%,#0b121c 100%)!important}
.phnx-ref-head{display:flex;align-items:center;gap:14px;margin-bottom:10px}
.phnx-ref-icon{display:grid;place-items:center;width:54px;height:54px;flex:0 0 54px;border-radius:15px;background:rgba(var(--accent-rgb),.14);box-shadow:inset 0 0 0 1px rgba(var(--accent-rgb),.08)}
.phnx-ref-icon svg{display:block!important;width:25px!important;height:25px!important;max-width:25px!important;max-height:25px!important;fill:none!important;stroke:var(--accent)!important;stroke-width:2!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.phnx-ref-title{display:block!important;color:#eef4fb!important;font-size:15px!important;font-weight:800!important;line-height:1.2!important}
.phnx-ref-value{display:block!important;white-space:nowrap!important;color:#fff!important;font-size:clamp(31px,2.2vw,40px)!important;line-height:1!important;font-weight:850!important;letter-spacing:-.04em!important;margin:2px 0 0!important}
.phnx-ref-delta{display:flex;align-items:center;gap:6px;min-height:20px;margin:9px 0 5px;color:#5be18b;font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}
.phnx-ref-delta.neutral{color:#8693a6}
.phnx-ref-delta small{font-size:11px!important;color:#8490a2!important;font-weight:700!important}
.phnx-ref-chart{position:relative;height:148px;margin-top:auto;cursor:crosshair;user-select:none}
.phnx-ref-chart svg{display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;overflow:visible!important}
.phnx-ref-chart .grid{stroke:#222c3a;stroke-width:1;vector-effect:non-scaling-stroke}
.phnx-ref-chart .axis{fill:#748195;font:10px system-ui}
.phnx-ref-chart .area{stroke:none}
.phnx-ref-chart .line{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 5px rgba(var(--accent-rgb),.33))}
.phnx-ref-chart .hoverline{stroke:#9aa8bc;stroke-width:1;opacity:0;vector-effect:non-scaling-stroke}
.phnx-ref-chart .dot{fill:var(--accent);stroke:#0b121c;stroke-width:2;opacity:0}
.phnx-ref-chart:hover .hoverline,.phnx-ref-chart:hover .dot{opacity:1}
.phnx-ref-tip{position:fixed;z-index:9999;pointer-events:none;min-width:120px;padding:8px 10px;border:1px solid #303b4d;border-radius:9px;background:rgba(7,11,17,.97);box-shadow:0 12px 30px rgba(0,0,0,.35);color:#eef4fb;font-size:11px}
.phnx-ref-tip strong,.phnx-ref-tip span{display:block}.phnx-ref-tip strong{font-size:14px}.phnx-ref-tip span{margin-top:2px;color:#8996a9}
.dashboard-metrics.phnx-ref-grid article>small{display:none!important}
@media(max-width:1200px){.dashboard-metrics.phnx-ref-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:720px){.phnx-ref-toolbar{align-items:stretch;flex-direction:column}.phnx-ref-periods{width:max-content;max-width:100%}.dashboard-metrics.phnx-ref-grid{grid-template-columns:1fr!important;gap:12px!important}.dashboard-metrics.phnx-ref-grid>article{min-height:285px!important;padding:18px 16px 14px!important}.phnx-ref-value{font-size:34px!important}.phnx-ref-chart{height:138px}}
