/* ============================================
   PROTON FACTS — Shared Stylesheet
   Anti-disinformation site · EN/FR
   ============================================ */

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --proton-purple: #6d4aff;
  --proton-purple-dark: #553acd;
  --proton-purple-light: #8b6fff;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f5ff;
  --bg-tertiary: #edeafb;
  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --border: #e2e0f0;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(109,74,255,.08);
  --shadow-md: 0 4px 12px rgba(109,74,255,.12);
  --shadow-lg: 0 12px 28px rgba(109,74,255,.15);
  --max-width: 960px;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

/* === TYPOGRAPHY === */
h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-weight: 700; margin-bottom: .75rem; }
p  { margin-bottom: 1rem; }
a  { color: var(--proton-purple); text-decoration: none; transition: color .2s; }
a:hover { color: var(--proton-purple-dark); }
strong { font-weight: 700; }
code { background: var(--bg-tertiary); padding: .15em .4em; border-radius: 4px; font-size: .9em; font-family: 'SF Mono', 'Fira Code', Consolas, monospace; }

/* === HEADER / NAV === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.nav {
  max-width: 1100px; margin: 0 auto; height: 100%; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-brand {
  font-weight: 800; font-size: 1.15rem; color: var(--proton-purple);
  display: flex; align-items: center; gap: .4rem; text-decoration: none;
}
.nav-brand:hover { color: var(--proton-purple-dark); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a {
  font-size: .9rem; font-weight: 500; color: var(--text-secondary);
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--proton-purple); }

.lang-toggle {
  display: flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border); border-radius: 8px; padding: .3rem .5rem;
  font-size: .8rem; cursor: pointer; background: var(--bg-primary);
}
.lang-toggle button {
  border: none; background: none; cursor: pointer; font-size: .8rem;
  padding: .15rem .4rem; border-radius: 4px; font-weight: 600; color: var(--text-secondary);
  transition: all .2s;
}
.lang-toggle button.active { background: var(--proton-purple); color: #fff; }

/* Mobile nav */
.nav-burger { display: none; background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--proton-purple); }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--bg-primary); border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem; gap: .75rem; box-shadow: var(--shadow-md);
  }
}

/* === LAYOUT === */
main { padding-top: var(--nav-h); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 1.5rem; }
.section--alt { background: var(--bg-secondary); }
.section--purple { background: var(--proton-purple); color: #fff; }
.section--purple a { color: #fff; text-decoration: underline; }
.section--purple h2 { color: #fff; }

.section-head { text-align: center; margin-bottom: 3rem; }
.section-head p { color: var(--text-secondary); max-width: 650px; margin: .75rem auto 0; }

/* === HERO (homepage) === */
.hero {
  min-height: 88vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6rem 1.5rem 4rem;
  background: linear-gradient(135deg, #6d4aff 0%, #5b3fd6 50%, #4a2db8 100%);
  color: #fff;
}
.hero h1 { margin-bottom: 1rem; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); opacity: .92; max-width: 720px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .8rem 1.6rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; transition: all .25s; cursor: pointer; border: 2px solid transparent;
}
.btn--primary { background: var(--proton-purple); color: #fff; }
.btn--primary:hover { background: var(--proton-purple-dark); transform: translateY(-2px); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.btn--outline { background: transparent; color: var(--proton-purple); border-color: var(--proton-purple); }
.btn--outline:hover { background: var(--proton-purple); color: #fff; }

.hero-stats { display: flex; gap: 2.5rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 2.2rem; font-weight: 800; display: block; }
.hero-stat-lbl { font-size: .85rem; opacity: .85; }

/* === SERVICE CARDS (homepage grid) === */
.service-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem;
}
.service-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; transition: all .3s; display: flex; flex-direction: column; gap: .75rem;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--proton-purple-light); }
.service-card-icon { font-size: 2.5rem; }
.service-card h3 { color: var(--proton-purple); }
.service-card p { color: var(--text-secondary); font-size: .92rem; flex-grow: 1; }
.service-card-meta { font-size: .8rem; color: var(--text-secondary); border-top: 1px solid var(--border); padding-top: .75rem; }

/* === SERVICE PAGE HEADER === */
.svc-hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 4rem 1.5rem 3rem; text-align: center;
}
.svc-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.svc-hero h1 { color: var(--proton-purple); }
.svc-meta { display: flex; gap: 1.5rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.svc-badge {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .35rem 1rem; font-size: .85rem; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: .4rem;
}
.svc-badge strong { color: var(--proton-purple); }

/* === SHORT ANSWER BOX === */
.short-answer {
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(109,74,255,.08));
  border: 1px solid rgba(16,185,129,.25); border-left: 5px solid var(--accent-green);
  border-radius: var(--radius); padding: 2rem; margin: 2rem 0;
}
.short-answer h2 { color: var(--accent-green); margin-bottom: .75rem; }
.short-answer p { font-size: 1.1rem; }

/* === LONG DESCRIPTION === */
.long-desc { margin-top: 3rem; }
.long-desc h2 { color: var(--proton-purple); margin-bottom: 1.5rem; }
.long-desc h3 { color: var(--text-primary); margin-top: 2rem; margin-bottom: .75rem; }
.long-desc p { margin-bottom: 1.2rem; }
.long-desc ul { margin: 1rem 0 1.2rem 1.5rem; }
.long-desc li { margin-bottom: .5rem; }

/* === COMPARISON TABLE === */
.compare-table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: .92rem; }
.compare-table th, .compare-table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { background: var(--bg-tertiary); font-weight: 700; color: var(--text-primary); }
.compare-table td:first-child { font-weight: 600; }

/* === FACT CARDS === */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.fact-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center;
}
.fact-card .fact-val { font-size: 2rem; font-weight: 800; color: var(--proton-purple); }
.fact-card .fact-lbl { font-size: .85rem; color: var(--text-secondary); margin-top: .25rem; }

/* === FAQ ACCORDION === */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.faq-q { padding: 1.1rem 1.5rem; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem; transition: background .2s; }
.faq-q:hover { background: var(--bg-secondary); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-item.active .faq-a { max-height: 600px; }
.faq-a-inner { padding: 0 1.5rem 1.1rem; color: var(--text-secondary); }
.faq-toggle { font-size: 1.3rem; color: var(--proton-purple); transition: transform .3s; flex-shrink: 0; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }

/* === RESOURCES — chapter nav === */
.res-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.res-toc { position: sticky; top: calc(var(--nav-h) + 1rem); align-self: start; }
.res-toc a { display: block; padding: .4rem .75rem; font-size: .88rem; color: var(--text-secondary); border-left: 3px solid transparent; border-radius: 0; transition: all .2s; }
.res-toc a:hover, .res-toc a.active { color: var(--proton-purple); border-left-color: var(--proton-purple); background: var(--bg-secondary); }
.res-chapter { margin-bottom: 3rem; scroll-margin-top: calc(var(--nav-h) + 2rem); }
.res-chapter h2 { color: var(--proton-purple); }
@media (max-width: 768px) { .res-layout { grid-template-columns: 1fr; } .res-toc { position: static; } }

/* === CALLOUT === */
.callout { background: var(--bg-tertiary); border-radius: var(--radius); padding: 1.5rem; margin: 1.5rem 0; }
.callout--warn { background: rgba(245,158,11,.1); border-left: 4px solid var(--accent-orange); }
.callout--info { background: rgba(109,74,255,.08); border-left: 4px solid var(--proton-purple); }
.callout--success { background: rgba(16,185,129,.08); border-left: 4px solid var(--accent-green); }

/* === FOOTER === */
.site-footer { background: #15132b; color: #ccc; padding: 3rem 1.5rem 1.5rem; }
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: #aaa; font-size: .88rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; color: #777; }

/* === UTILITY === */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-2 { margin-bottom: 2rem; }
.tag { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.tag--green { background: rgba(16,185,129,.12); color: var(--accent-green); }
.tag--red { background: rgba(239,68,68,.12); color: var(--accent-red); }
.tag--purple { background: rgba(109,74,255,.12); color: var(--proton-purple); }