/* SC2 — Stella Caltagirone Consulting */

@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #17161B;
  --bg-deep: #111014;
  --panel: #211F27;
  --rule: #35323E;
  --text: #ECEAF1;
  --muted: #A6A2B2;
  --violet: #6F00FF;     /* couleur du logo : traits, aplats */
  --cyber: #A77BFF;      /* violet éclairci, lisible sur fond sombre */
  --print: #E9A23B;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--text); color: var(--bg); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 1.0625rem; }
.brand img { width: 52px; height: auto; }
.nav { display: flex; gap: clamp(12px, 2.5vw, 28px); font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--text); }
.nav .nav-contact { color: var(--text); border-bottom: 2px solid var(--violet); }

/* Hero */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); border-bottom: 1px solid var(--rule); background: radial-gradient(ellipse at 76% 45%, #2A1F45 0%, transparent 58%), var(--bg); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.25rem); }
.hero h1 span { display: block; }
.hero h1 .l1 { color: var(--text); }
.hero h1 .l2 { color: var(--muted); }
.hero .lede { margin-top: 28px; max-width: 34em; font-size: 1.1875rem; color: #CFCBD8; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { display: inline-block; padding: 13px 22px; font: 500 1rem var(--body); text-decoration: none; border: 1px solid var(--rule); border-radius: 3px; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #fff; }
.btn-ghost:hover { border-color: var(--muted); }

.hero-logo { display: block; justify-self: center; width: 100%; max-width: 440px; }
.hero-logo > picture img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 48px rgba(111, 0, 255, 0.28)); }

/* Sections */
section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 64px); align-items: end; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); max-width: 36em; margin: 0; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 12px; vertical-align: 0.15em; }
#cybersecurite .swatch { background: var(--violet); }
#conception-3d .swatch { background: var(--print); }

.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.offer { padding: 28px clamp(16px, 2.5vw, 32px) 8px 0; }
.offer + .offer { padding-left: clamp(16px, 2.5vw, 32px); border-left: 1px solid var(--rule); }
.offer h3 { font-size: 1.375rem; margin-bottom: 14px; }
.offer p { color: #CFCBD8; }
.offer ul { margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--muted); }
.offer li { padding: 6px 0 6px 18px; position: relative; }
.offer li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 8px; height: 1px; background: currentColor; }
#cybersecurite .offer { border-top: 2px solid var(--violet); margin-top: -1px; }
#conception-3d .offer { border-top: 2px solid var(--print); margin-top: -1px; }

#conception-3d { background: var(--bg-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.note { margin-top: 36px; padding: 18px 22px; background: var(--panel); border-radius: 3px; color: var(--muted); font-size: 0.9375rem; max-width: 52em; }
.note strong { color: var(--text); font-weight: 500; }

/* About */
.about .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 64px); }
.about h2 { font-size: clamp(2rem, 4vw, 3rem); }
.about .body { max-width: 38em; }
.about .body p:first-child { font-size: 1.1875rem; color: var(--text); }
.about .body p { color: #CFCBD8; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; border-top: 1px solid var(--rule); }
.steps li { counter-increment: step; padding: 24px 24px 0 0; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-weight: 500; font-size: 2.25rem; color: var(--rule); margin-bottom: 8px; line-height: 1; }
.steps h3 { font-size: 1.125rem; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 0.9375rem; }
#demarche { border-top: 1px solid var(--rule); }

/* Contact */
.contact { background: var(--panel); border-top: 1px solid var(--rule); }
.contact .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-bottom: 20px; }
.contact p { color: #CFCBD8; max-width: 32em; }
.contact dl { margin: 0; display: grid; gap: 18px; }
.contact dt { font-size: 0.875rem; color: var(--muted); }
.contact dd { margin: 2px 0 0; font-size: 1.0625rem; }
.contact dd a { text-decoration-color: var(--cyber); text-underline-offset: 4px; }

/* Footer */
.site-footer { background: var(--bg-deep); border-top: 1px solid var(--rule); padding: 32px 0 40px; font-size: 0.875rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer p { margin: 0; }

/* Legal page */
.legal { padding: clamp(48px, 7vw, 88px) 0; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 32px; }
.legal h2 { font-size: 1.375rem; margin: 40px 0 12px; }
.legal p, .legal li { color: #CFCBD8; }
.legal .todo { color: var(--print); }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap, .section-head, .about .wrap, .contact .wrap { grid-template-columns: 1fr; }
  .hero-logo { max-width: 300px; justify-self: start; grid-row: 1; }
  .offers { grid-template-columns: 1fr; border-top: 0; }
  .offer, .offer + .offer { padding: 24px 0 8px; border-left: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nav a:not(.nav-contact) { display: none; }
  .brand span { display: none; }
  .steps { grid-template-columns: 1fr; }
  .hero-logo { max-width: 220px; }
}

/* Logo animé (trois entrées tirées au hasard, impulsions, inclinaison) */
/* Logo SC2 animé — calques : fond, pistes, nœuds, lettres, triangle CIA, contour, libellés */
.sc2-logo { position: relative; display: block; width: 100%; aspect-ratio: 899.24 / 700.217; perspective: 900px; }
.sc2-logo .stage { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.25s ease-out; will-change: transform; }
.sc2-logo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sc2-logo .halo { position: absolute; inset: 0; filter: drop-shadow(0 18px 48px rgba(111, 0, 255, 0.30)); }

.sc2-logo .letters, .sc2-logo .labels { transition: transform 0.25s ease-out; }
.sc2-logo .letters { transform: translate(calc(var(--mx, 0) * 16px), calc(var(--my, 0) * 16px)); }
.sc2-logo .labels { transform: translate(calc(var(--mx, 0) * 9px), calc(var(--my, 0) * 9px)); }

.sc2-logo .pulses { opacity: 0; }
.sc2-logo .ghost { display: none; }
.sc2-logo .nozzle { display: none; }

@media (prefers-reduced-motion: no-preference) {

  /* --- A. Mise sous tension --- */
  .sc2-logo[data-intro="circuit"] .outline { stroke-dasharray: 1; animation: draw 1s cubic-bezier(.6,0,.3,1) 0.1s both; }
  .sc2-logo[data-intro="circuit"] .bgfill { animation: fade 0.8s ease 0.5s both; }
  .sc2-logo[data-intro="circuit"] .trace { stroke-dasharray: 1; animation: draw 0.7s ease-out both; animation-delay: calc(1s + var(--i) * 0.12s); }
  .sc2-logo[data-intro="circuit"] .trace.rev { animation-name: draw-rev; }
  .sc2-logo[data-intro="circuit"] .node { transform-box: fill-box; transform-origin: center; animation: pop 0.45s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(1.45s + var(--i) * 0.15s); }
  .sc2-logo[data-intro="circuit"] .lt { stroke-dasharray: 1; animation: draw 1s ease-in-out 1.5s both, fill-in 0.5s ease 2.35s both; }
  .sc2-logo[data-intro="circuit"] .cia { stroke-dasharray: 1; animation: draw 0.6s ease-out 2.4s both; }
  .sc2-logo[data-intro="circuit"] .lab { animation: fade 0.5s ease both; animation-delay: calc(2.8s + var(--i) * 0.18s); }

  /* --- B. Impression 3D : couche par couche depuis la pointe, avec la buse --- */
  .sc2-logo[data-intro="print"] .halo svg { animation: print-reveal 2.4s steps(48, end) 0.2s both; }
  .sc2-logo[data-intro="print"] .nozzle { display: block; position: absolute; inset: 0; pointer-events: none;
    clip-path: polygon(0.6% 1%, 99.6% 1%, 50.1% 99.2%); }
  .sc2-logo[data-intro="print"] .nozzle::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; bottom: 0;
    background: #E4D6FF; box-shadow: 0 0 10px 3px #8A3DFF, 0 0 28px 8px rgba(111,0,255,.55);
    animation: nozzle 2.4s steps(48, end) 0.2s both; }
  .sc2-logo[data-intro="print"] .lt { animation: fill-in 0.5s ease 2.5s both; }
  .sc2-logo[data-intro="print"] .lab { animation: fade 0.5s ease both; animation-delay: calc(2.6s + var(--i) * 0.15s); }

  /* --- C. Glitch : le logo se « déchiffre » --- */
  .sc2-logo[data-intro="glitch"] .halo svg { animation: flicker 1.1s steps(1, end) 0.15s both; }
  .sc2-logo[data-intro="glitch"] .ghost { display: block; mix-blend-mode: screen; opacity: 0; }
  .sc2-logo[data-intro="glitch"] .ghost.g1 { filter: hue-rotate(-70deg) saturate(2); animation: slice-a 1.1s steps(1, end) 0.15s both; }
  .sc2-logo[data-intro="glitch"] .ghost.g2 { filter: hue-rotate(110deg) saturate(2); animation: slice-b 1.1s steps(1, end) 0.15s both; }
  .sc2-logo[data-intro="glitch"] .lab { animation: fade 0.35s steps(3, end) both; animation-delay: calc(1.3s + var(--i) * 0.12s); }

  /* --- En continu : impulsions dans les pistes + halo qui respire --- */
  .sc2-logo[data-live="on"] .pulses { opacity: 1; }
  .sc2-logo[data-live="on"] .pulse { stroke-dasharray: var(--dash) 2; stroke-dashoffset: var(--dash);
    animation: pulse 5.6s linear infinite; animation-delay: calc(var(--start) + var(--i) * 0.55s); }
  .sc2-logo[data-live="on"] .pulse.rev { animation-name: pulse-rev; }
  .sc2-logo[data-live="on"] .node { animation: blink 5.6s ease-in-out infinite; animation-delay: calc(var(--start) + 0.8s + var(--i) * 1.1s); }
  .sc2-logo[data-live="on"][data-intro="circuit"] .node { animation: pop 0.45s cubic-bezier(.3,1.6,.5,1) both, blink 5.6s ease-in-out infinite;
    animation-delay: calc(1.45s + var(--i) * 0.15s), calc(var(--start) + 0.8s + var(--i) * 1.1s); }
  .sc2-logo[data-live="on"] .cia-glow { animation: cia 5.6s ease-in-out infinite; animation-delay: calc(var(--start) + 0.9s); }
}

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes draw-rev { from { stroke-dashoffset: -1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fill-in { from { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes print-reveal { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes nozzle { 0% { bottom: 0; opacity: 1; } 96% { opacity: 1; } 100% { bottom: 99%; opacity: 0; } }
@keyframes flicker {
  0% { opacity: 0; } 8% { opacity: .7; clip-path: inset(10% 0 55% 0); } 16% { opacity: 0; } 24% { opacity: 1; clip-path: inset(40% 0 20% 0); }
  34% { clip-path: inset(0 0 70% 0); } 44% { opacity: .4; clip-path: inset(60% 0 0 0); } 54% { opacity: 1; clip-path: inset(0 0 0 0); }
  62% { opacity: .6; } 70%, 100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes slice-a {
  0% { opacity: 0; } 12% { opacity: .9; transform: translate(-14px, 0); clip-path: inset(18% 0 62% 0); }
  26% { transform: translate(10px, 0); clip-path: inset(52% 0 30% 0); } 40% { transform: translate(-6px, 0); clip-path: inset(5% 0 80% 0); }
  56% { transform: translate(4px, 0); clip-path: inset(70% 0 8% 0); } 70%, 100% { opacity: 0; transform: none; }
}
@keyframes slice-b {
  0% { opacity: 0; } 16% { opacity: .9; transform: translate(12px, 0); clip-path: inset(35% 0 40% 0); }
  30% { transform: translate(-9px, 0); clip-path: inset(75% 0 5% 0); } 46% { transform: translate(7px, 0); clip-path: inset(22% 0 60% 0); }
  62% { transform: translate(-3px, 0); clip-path: inset(48% 0 38% 0); } 74%, 100% { opacity: 0; transform: none; }
}
@keyframes pulse { 0% { stroke-dashoffset: var(--dash); } 30%, 100% { stroke-dashoffset: -1; } }
@keyframes pulse-rev { 0% { stroke-dashoffset: -1; } 30%, 100% { stroke-dashoffset: var(--dash); } }
@keyframes blink { 0%, 20%, 100% { stroke: #6F00FF; } 8% { stroke: #D9C4FF; } }
@keyframes cia { 0%, 40%, 100% { fill-opacity: 0; } 18% { fill-opacity: .35; } }
