/* =====================================================================
   Vidforges — Global Stylesheet
   Targets: WCAG 2.2 AA | Core Web Vitals 2025 | System fonts only
   Files using these styles: all EN/FR pages delivered in this project
   ===================================================================== */

/* -------------------------
   CSS Variables (Brand)
-------------------------- */
:root{
  --brand-primary:#6D5EF3;
  --brand-accent:#00B8D9;
  --brand-dark:#0F172A;
  --brand-muted:#64748B;
  --brand-light:#F8FAFC;
  --brand-white:#FFFFFF;

  --bg:var(--brand-light);
  --text:#0B1220;
  --text-muted:#475569;
  --border:#E2E8F0;
  --shadow:0 10px 25px rgba(15,23,42,.08);
  --radius:1.25rem;

  /* Typography scale */
  --fs-xs:.8125rem;
  --fs-sm:.9375rem;
  --fs-base:1rem;
  --fs-lg:1.125rem;
  --fs-xl:1.375rem;
  --fs-2xl:1.75rem;
  --fs-3xl:2.25rem;
  --fs-4xl:3rem;

  /* Layout */
  --container:1200px;
  --gutter:1rem;
}

/* -------------------------
   Reset / Base
-------------------------- */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  background:var(--bg);
  font:400 var(--fs-base)/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Prefer-reduced-motion: tone down animations/videos */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important}
  .hero-video{display:none}
}

/* -------------------------
   Utilities
-------------------------- */
.container{
  width:100%;
  max-width:calc(var(--container) + var(--gutter)*2);
  margin-inline:auto;
  padding-inline:var(--gutter);
}

.visually-hidden{position:absolute!important;clip:rect(1px,1px,1px,1px)!important;padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden!important;white-space:nowrap!important}

.skip-link{
  position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;
}
.skip-link:focus{
  left:var(--gutter);top:var(--gutter);width:auto;height:auto;z-index:9999;
  background:var(--brand-white); color:var(--brand-dark);
  padding:.5rem .75rem; border-radius:.5rem; box-shadow:var(--shadow);
}

/* Focus visible */
:where(a,button,input,summary,[tabindex]):focus-visible{
  outline:3px solid var(--brand-accent);
  outline-offset:2px;
  border-radius:.25rem;
}

/* Links */
a{color:var(--brand-primary);text-decoration:none}
a:hover{text-decoration:underline}
a:active{opacity:.9}

/* Type */
.h1{font-size:clamp(2rem,3.2vw,var(--fs-4xl));line-height:1.1;margin:0 0 .5rem}
.h2{font-size:clamp(1.5rem,2.1vw,var(--fs-3xl));line-height:1.2;margin:0 0 .75rem}
.h3{font-size:clamp(1.125rem,1.6vw,var(--fs-2xl));line-height:1.25;margin:.5rem 0}

.h1,.h2,.h3{letter-spacing:-.01em}
@supports (text-wrap:balance){
  .h1,.h2,.h3{text-wrap:balance}
}
@supports (text-wrap:pretty){
  p,li,figcaption{text-wrap:pretty}
}
@supports (hyphens:auto){
  html[lang="fr"] :where(p,li,figcaption,summary){hyphens:auto}
}

.lead{font-size:var(--fs-lg);color:var(--text-muted);max-width:65ch}

.small{font-size:var(--fs-sm);color:var(--text-muted)}
.kicker{letter-spacing:.06em;text-transform:uppercase;color:var(--brand-primary);font-weight:600;font-size:var(--fs-sm)}

/* Prose blocks (articles / legal pages) */
.prose{
  max-width:78ch; margin-inline:auto; text-align:left;
}
.prose h2{margin-top:2rem}
.prose p{margin:.75rem 0}
.prose ul, .prose ol{padding-left:1.25rem}
.prose li{margin:.375rem 0}
.code-block{
  background:#0f172a; color:#e2e8f0; border-radius:.75rem; padding:1rem 1.25rem;
  overflow:auto; box-shadow:var(--shadow); border:1px solid #0b1220;
}

/* -------------------------
   Header / Nav / Drawer
-------------------------- */
.site-header{
  position:sticky; top:0; z-index:1000; background:rgba(248,250,252,.85); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex; align-items:center; justify-content:flex-start; gap:1rem; min-height:64px; width:100%;
}
.header-inner .brand{flex-shrink:0}
.header-actions{
  margin-left:auto;
  display:flex; align-items:center; gap:.75rem;
}
.brand img{display:block;height:auto}

.burger{
  -webkit-tap-highlight-color:transparent;
  background:transparent; border:1px solid var(--border); border-radius:.75rem; padding:.5rem;
  display:inline-flex; flex-direction:column; gap:4px; cursor:pointer;
}
.burger-bar{display:block; width:22px; height:2px; background:var(--brand-dark); border-radius:2px}

.drawer{
  position:fixed; inset:0; pointer-events:none; z-index:1100;
}
.drawer .drawer-overlay{
  position:absolute; inset:0; background:rgba(2,6,23,.45); opacity:0; transition:opacity .2s ease; pointer-events:none;
}
.drawer .drawer-header{
  display:flex; justify-content:flex-end; padding:1rem; border-bottom:1px solid var(--border);
}
.icon-btn{
  background:var(--brand-white); border:1px solid var(--border); border-radius:.75rem; padding:.375rem .5rem; cursor:pointer;
  font-size:1.25rem; line-height:1;
}

.drawer-nav{
  position:absolute; top:0; right:0; height:100%; width:min(420px,90vw);
  background:var(--brand-white); transform:translateX(100%); transition:transform .22s ease; box-shadow:var(--shadow);
  display:flex; flex-direction:column; padding:1rem 1.25rem;
}
.drawer-nav ul{list-style:none; margin:0; padding:0}
.drawer-nav li{border-bottom:1px solid var(--border)}
.drawer-nav a, .drawer-nav button{
  display:block; padding:1rem .5rem; color:var(--brand-dark); font-weight:600; width:100%; text-align:left; background:none; border:none;
}
.drawer.is-open{pointer-events:auto}
.drawer.is-open .drawer-overlay{opacity:1; pointer-events:auto}
.drawer.is-open .drawer-nav{transform:translateX(0)}

/* Desktop inline nav fallback (optional if JS progressively enhances) */
/* You may place inline nav in header with CSS if desired later. */

/* -------------------------
   Buttons
-------------------------- */
.btn{
  --btn-bg:var(--brand-primary);
  --btn-fg:#fff;
  --btn-border:transparent;
  appearance:none; -webkit-appearance:none;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  padding:.7rem 1rem; border-radius:.9rem; border:1px solid var(--btn-border);
  background:var(--btn-bg); color:var(--btn-fg); font-weight:700; text-decoration:none; cursor:pointer;
  transition:transform .06s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  box-shadow:0 2px 8px rgba(109,94,243,.25);
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn.btn-primary{--btn-bg:var(--brand-primary);--btn-fg:#fff}
.btn.btn-primary:hover{box-shadow:0 6px 20px rgba(109,94,243,.35)}
.btn.btn-ghost{--btn-bg:#ffffff;--btn-fg:var(--brand-dark);--btn-border:var(--border); box-shadow:none}
.btn.btn-ghost:hover{background:#F1F5F9}
.btn.btn-link{
  --btn-bg:transparent; --btn-fg:var(--brand-primary); --btn-border:transparent; padding:.25rem 0; box-shadow:none
}
.lang-switch{
  border:1px solid var(--border); border-radius:.75rem; background:#fff; padding:.5rem .75rem; cursor:pointer; font-weight:700;
}

/* -------------------------
   Sections / Layout blocks
-------------------------- */
.section{padding:clamp(2rem,5vw,4rem) 0}
.section[id]{scroll-margin-top:clamp(4rem,12vw,7rem)}
.section .container{
  text-align:center;
}
.section .container > *{
  margin-left:auto;
  margin-right:auto;
}
.page-hero{
  padding:clamp(2rem,6vw,4.5rem) 0 1rem;
  background:linear-gradient(180deg,#ffffff, #F8FAFC);
  border-bottom:1px solid var(--border);
}
.page-hero.slim{padding:2.25rem 0}

.hero{
  position:relative; min-height:min(86vh, 720px); display:grid; place-items:center; border-bottom:1px solid var(--border);
  background:var(--brand-light);
}
.hero::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(8,15,32,.55) 0%, rgba(8,15,32,.35) 45%, rgba(8,15,32,.6) 100%);
  pointer-events:none;
}
.hero-bg{position:absolute; inset:0; overflow:hidden; border-bottom:1px solid var(--border)}
.hero-video{
  width:100%; height:100%; object-fit:cover; display:block; opacity:.85; filter:saturate(112%) contrast(118%);
  pointer-events:none; transform:scale(1.04);
}
.hero-content{
  position:relative; z-index:1; text-align:center; max-width:820px; margin-inline:auto; padding:0 var(--gutter);
  color:#F8FAFC; text-shadow:0 18px 38px rgba(8,15,32,.45);
}
.hero .badge{
  background:rgba(255,255,255,.12); color:#E2E8F0; border:1px solid rgba(255,255,255,.4);
}
.hero .lead{color:rgba(236,241,255,.9)}
.hero .btn.btn-primary{box-shadow:0 18px 45px rgba(109,94,243,.45)}
.hero .btn.btn-ghost{background:rgba(255,255,255,.9); color:var(--brand-dark)}
.hero .btn.btn-ghost:hover{background:#fff}
.hero .note{color:rgba(244,247,255,.82)}
.badge{
  display:inline-block; background:rgba(0,184,217,.12); color:#024b57; border:1px solid rgba(0,184,217,.35);
  padding:.25rem .6rem; border-radius:999px; font-weight:700; font-size:var(--fs-sm); margin-bottom:.75rem;
}
.note{color:var(--text-muted); font-size:var(--fs-sm); margin-top:.75rem}

.grid-3, .grid-4{
  display:grid; gap:1rem;
}
.grid-3{grid-template-columns:repeat(1,minmax(0,1fr)); justify-items:center}
.grid-4{grid-template-columns:repeat(1,minmax(0,1fr)); justify-items:center}
@media (min-width:700px){
  .grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
}

.card{
  background:var(--brand-white); border:1px solid var(--border); border-radius:var(--radius);
  padding:1rem 1.1rem; box-shadow:var(--shadow); text-align:center;
}
.feature{
  background:var(--brand-white); border:1px solid var(--border); border-radius:var(--radius);
  padding:1rem 1.1rem; box-shadow:var(--shadow); text-align:center;
}

/* Bulleted lists */
.bullets{
  display:grid; gap:.5rem; margin:0 auto; padding:0; max-width:60ch;
  text-align:center; list-style-position:inside;
}

/* Masonry-like simple grid */
.masonry{
    display:grid; grid-template-columns:1fr; gap:1.5rem;
  }
  .tile{margin:0; background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow)}
  .tile img{width:100%; height:auto; display:block}
  .tile figcaption{padding:.5rem .75rem; font-size:var(--fs-sm); color:var(--text-muted)}
@media (min-width:720px){ .masonry{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (min-width:1100px){ .masonry{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))} }

/* Video section (YouTube click-to-play placeholder) */
.video-frame{
  position:relative; display:block; max-width:960px; margin:0 auto; cursor:pointer;
  border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); box-shadow:var(--shadow);
  background:#000; aspect-ratio:16 / 9;
}
.video-frame img,
.video-frame iframe{
  display:block; width:100%; height:100%; object-fit:cover; border:0;
}
.play-btn{
  position:absolute; inset:auto 50% 50% auto; transform:translate(50%,50%); width:72px; height:72px; border-radius:999px;
  background:var(--brand-primary); color:#fff; border:none; box-shadow:0 12px 30px rgba(109,94,243,.45);
}
.play-btn::before{
  content:""; display:block; width:0; height:0; margin:auto; border-left:16px solid #fff; border-top:10px solid transparent; border-bottom:10px solid transparent; transform:translateX(3px);
}

/* Demo grid (video samples) */
.demo-grid{
    display:grid; grid-template-columns:repeat(1,minmax(0,1fr)); gap:1.25rem; align-items:stretch;
  }
@media (min-width:700px){ .demo-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (min-width:1024px){ .demo-grid{grid-template-columns:repeat(4,minmax(0,1fr))} }
  .demo{
    display:flex; flex-direction:column; background:#fff; border:1px solid var(--border); border-radius:var(--radius);
    overflow:hidden; box-shadow:var(--shadow);
  }
  .demo-video{
    width:100%; flex:1 1 auto; display:block; background:#000; border-bottom:1px solid var(--border);
    aspect-ratio:9 / 16; object-fit:cover;
  }
  .demo figcaption{padding:.75rem 1rem; font-size:var(--fs-sm); color:var(--text-muted); text-align:center}

/* CTA band */
.cta-wide{
  background:linear-gradient(180deg,#fff, #F1F5F9);
  border-top:1px solid var(--border); border-bottom:1px solid var(--border);
}
.cta-container{
  display:grid; gap:1rem; align-items:center;
}
@media (min-width:880px){
  .cta-container{grid-template-columns:1.4fr .6fr}
  .cta-actions{justify-self:end}
}
.cta-row{display:flex; gap:.75rem; flex-wrap:wrap; justify-content:center}

/* Tables */
.table-wrap{overflow:auto;border-radius:.75rem;border:1px solid var(--border);background:#fff}
.table{width:100%; border-collapse:separate; border-spacing:0}
.table th,.table td{padding:.65rem .75rem; border-bottom:1px solid var(--border); text-align:left}
.table thead th{background:#F1F5F9; font-weight:700}

/* Search form */
.search{
  margin-top:1rem; display:flex; gap:.5rem; align-items:center; justify-content:center; flex-wrap:wrap;
}
.search input[type="search"]{
  flex:1 1 260px; max-width:420px; background:#fff; border:1px solid var(--border); border-radius:.75rem;
  padding:.7rem .9rem; font-size:var(--fs-base);
}

/* Posts grid */
.posts-grid{
  display:grid; grid-template-columns:repeat(1,minmax(0,1fr)); gap:1rem; justify-items:center;
}
@media (min-width:900px){ .posts-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
.post-card{
  background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  display:grid; grid-template-columns:1fr; min-height:100%;
}
.post-card .thumb img{width:100%; height:auto; display:block}
.post-body{padding:1rem 1.1rem; text-align:center}
.post-body .meta{color:var(--text-muted); font-size:var(--fs-sm)}

/* Blog article pages */
.article-page main{padding-block:2.5rem 3.5rem}
.article-page .post-header{text-align:center; margin-bottom:2.5rem}
.article-page .kicker{letter-spacing:.1em}
.article-page h1{margin-bottom:1rem; font-size:clamp(2.2rem,4vw,3.1rem); line-height:1.08; letter-spacing:-.018em}
.article-page h2{font-size:clamp(1.6rem,2.4vw,2.25rem); line-height:1.2}
.article-page .meta{
  display:flex; gap:.6rem; justify-content:center; flex-wrap:wrap;
  font-size:var(--fs-sm); color:var(--text-muted);
}
.article-page .post-hero{
  margin:2rem auto 0; max-width:min(960px, 92vw); border-radius:calc(var(--radius) * .9);
  overflow:hidden; box-shadow:var(--shadow); background:#020617;
}
.article-page .post-hero img{
  width:100%; height:100%; display:block; object-fit:cover; aspect-ratio:16 / 9;
}
.article-page .post-hero figcaption{
  margin:0; padding:.75rem 1rem; font-size:var(--fs-sm); color:var(--text-muted); background:#fff;
}
.article-page .prose{font-size:1.05rem; line-height:1.75}
.article-page .prose p{margin:1rem 0}
.article-page .prose ul,
.article-page .prose ol{margin:1rem 0 1.25rem}
.article-page .prose li{margin:.45rem 0}
.article-page .callout{text-align:left}

/* Article footer, callouts */
.callouts{display:grid; gap:1rem; grid-template-columns:1fr; margin-top:1rem}
.callout{background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:1rem; box-shadow:var(--shadow); text-align:center}
@media (min-width:880px){ .callouts{grid-template-columns:1fr 1fr} }

/* -------------------------
   Footer
-------------------------- */
.site-footer{
  margin-top:2rem; border-top:1px solid var(--border); background:#fff;
}
.footer-grid{
  display:grid; gap:1rem; padding:1.25rem 0;
}
.footer-nav{
  display:flex; flex-wrap:wrap; gap:.75rem 1rem; align-items:center;
}
.footer-nav a, .footer-nav button{
  color:var(--brand-dark); font-weight:600; background:none;
  border:1px solid var(--border); border-radius:.6rem; padding:.4rem .65rem; text-decoration:none;
}
.kling-note{color:var(--text-muted); padding:.25rem var(--gutter) 1rem}

/* -------------------------
   Consent Banner (Modal)
-------------------------- */
#consent[hidden]{display:none}
#consent{
  position:fixed; inset:0; z-index:1200; display:grid; place-items:center; background:rgba(2,6,23,.45);
  padding:1rem;
}
#consent .consent-inner{
  width:min(560px, 95vw); background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:1rem 1.25rem;
}
.consent-actions{display:flex; gap:.5rem; flex-wrap:wrap; margin-top:.75rem}

/* -------------------------
   Forms, details, misc
-------------------------- */
details{
  background:#fff; border:1px solid var(--border); border-radius:.8rem; padding:.75rem 1rem; margin:.65rem 0;
  transition:border-color .2s ease, box-shadow .2s ease;
}
details[open]{border-color:rgba(109,94,243,.4); box-shadow:0 14px 30px rgba(15,23,42,.08)}
summary{
  font-weight:700; cursor:pointer; display:flex; align-items:center; gap:.75rem; list-style:none; color:var(--brand-dark);
}
summary::-webkit-details-marker{display:none}
summary::after{
  content:""; margin-left:auto; width:.75rem; height:.75rem;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:rotate(45deg); transition:transform .2s ease;
}
details[open] summary::after{transform:rotate(-135deg)}
details .answer{margin-top:.5rem; color:var(--text-muted); text-align:center}
details + details{margin-top:.75rem}

/* -------------------------
   Responsive tweaks
-------------------------- */
@media (min-width:980px){
  .header-inner{min-height:72px}
  .lead{font-size:1.1875rem}
}

/* -------------------------
   Print
-------------------------- */
@media print{
  .site-header,.site-footer,.drawer,.hero,.video-section,#consent{display:none!important}
  body{background:#fff}
  a{text-decoration:underline}
}

/* -------------------------
   Animations (gentle, GPU)
-------------------------- */
@keyframes floatFade{
  from{opacity:.85; transform:translate3d(0,6px,0)}
  to{opacity:1; transform:translate3d(0,0,0)}
}
.hero-content{animation:floatFade .36s ease both}

/* -------------------------
   Accessibility color checks
   - Buttons and text meet or exceed AA contrast on light bg
-------------------------- */

/* -------------------------
   Helper classes
-------------------------- */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.center{text-align:center}
