/* ═══════════════════════════════════════════════════
   SIGNES COSMIQUES V2 — Design System
   Xtract glows + HeyMessage cinema + Co-Star identity
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* --- RESET --- */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* --- TOKENS --- */
:root{
  /* Fonts — Signes Cosmiques identity */
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Backgrounds */
  --bg: #0A0A0A;
  --bg-card: #121212;
  --bg-card-hover: #1a1a1a;
  --bg-elevated: #181818;

  /* Text */
  --heading: #FFFFFF;
  --text: #DEDEDE;
  --muted: #858585;
  --subtle: rgba(255,255,255,0.12);

  /* Accent — Cosmic Violet */
  --accent: rgb(129, 74, 200);
  --accent-light: rgb(223, 122, 254);
  --accent-glow: rgba(129, 74, 200, 0.15);
  --accent-glow-strong: rgba(129, 74, 200, 0.3);

  /* Borders */
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --border-accent: rgba(129, 74, 200, 0.3);

  /* Radius — Co-Star sharp */
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 60px rgba(129,74,200,0.08);
  --shadow-glow-strong: 0 0 120px rgba(129,74,200,0.15);

  /* Spacing */
  --section-pad: 160px 0;
  --container: 1200px;
  --gap: 24px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;
}

/* --- BASE --- */
html{
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

html{
  overflow-x: hidden;
  width: 100%;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
}

/* Pages with gate/app layout need flex column for centering */
body.page-app{
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  max-width: 100vw;
  width: 100%;
}

/* --- NOISE OVERLAY (cinema texture) --- */
body::before{
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('/css/noise.png') repeat;
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* --- TYPOGRAPHY --- */
h1,h2,h3,h4,h5,h6{
  font-family: var(--font-heading);
  color: var(--heading);
  line-height: 1.15;
  font-weight: 500;
}

h1{
  font-size: clamp(44px, 7vw, 80px);
  letter-spacing: -1px;
  font-weight: 400;
  line-height: 1.1;
}

h2{
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.5px;
  font-weight: 400;
  line-height: 1.15;
}

h3{
  font-size: clamp(22px, 2.5vw, 28px);
  letter-spacing: 0;
  font-weight: 400;
}

h4{
  font-size: 17px;
  font-weight: 500;
  font-family: var(--font-body);
}

p{
  color: var(--text);
  max-width: 680px;
}

a{
  color: var(--heading);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover{
  color: var(--accent-light);
}

/* --- EYEBROW --- */
.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-light);
  margin-bottom: 16px;
}

/* --- CONTAINER --- */
.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- SECTION --- */
.section{
  padding: var(--section-pad);
  will-change: opacity, transform;
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.section-center{ text-align: center; }
.section-center p{ margin: 16px auto 0; }

/* --- BUTTONS --- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 32px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
}

.btn-primary{ background: var(--heading); color: var(--bg); }
.btn-primary:hover{ background: var(--text); color: var(--bg); transform: translateY(-1px); }

.btn-secondary{ background: transparent; color: var(--heading); border: 1px solid var(--border-hover); }
.btn-secondary:hover{ border-color: var(--heading); background: rgba(255,255,255,0.04); }

.btn-accent{ background: var(--accent); color: white; }
.btn-accent:hover{ background: var(--accent-light); transform: translateY(-1px); box-shadow: var(--shadow-glow-strong); }

/* --- CARDS --- */
.card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 32px;
  transition: all var(--duration) var(--ease);
}

.card:hover{
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.card-glow{ position: relative; overflow: hidden; }

.card-glow::before{
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  background: conic-gradient(from 180deg, transparent, var(--accent), transparent 40%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  z-index: -1;
}

.card-glow:hover::before{ opacity: 0.5; }

/* --- SCROLL ANIMATIONS --- */
.reveal{
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible{ opacity: 1; transform: translateY(0); }

.reveal-stagger > *{
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-stagger.visible > *:nth-child(1){ transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2){ transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3){ transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4){ transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5){ transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(6){ transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* --- PAGE TRANSITION --- */
#page-fade{
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg);
  z-index: 99999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
}

/* --- GLOW BACKGROUNDS --- */
.glow-violet{
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(80px);
}

/* --- RESPONSIVE --- */
@media(max-width: 768px){
  :root{ --section-pad: 80px 0; --gap: 16px; }
  body{ font-size: 16px; }
  input, select, textarea{ font-size: 16px; }
}

@media(max-width: 480px){
  :root{ --section-pad: 60px 0; }
  .container{ padding: 0 16px; }
}

::selection{ background: var(--accent); color: white; }
