/* =========================================================================
   GLOBAL PUBLIC OPINION SURVEY — STYLESHEET
   Neutral, symmetric design: both voting options share identical markup
   and identical styling rules — no per-side color or emphasis overrides.
   ========================================================================= */

/* Fonts (Libre Franklin, IBM Plex Mono) are loaded via a preconnected
   <link rel="stylesheet"> in index.html's <head> rather than @import
   here, so the browser can fetch them in parallel with this file
   instead of waiting for this file to finish downloading first. */

:root {
  --accent: #3457D5;
  --accent-2: #6C63FF;
  --success: #1E8E5A;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Libre Franklin', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

[data-theme="light"] {
  --bg: #F4F6FB;
  --bg-alt: #EAEEF7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --border: rgba(20, 30, 60, 0.10);
  --text: #161C2B;
  --text-dim: #5B6478;
  --shadow: 0 12px 32px rgba(20, 30, 60, 0.08);
  --hero-gradient: linear-gradient(160deg, #EEF2FC 0%, #F7F5FF 45%, #FDF3F0 100%);
}

[data-theme="dark"] {
  --bg: #0D1117;
  --bg-alt: #10141C;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-solid: #161B26;
  --border: rgba(255, 255, 255, 0.10);
  --text: #EBEFF7;
  --text-dim: #97A1B8;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --hero-gradient: linear-gradient(160deg, #10141C 0%, #161A2A 50%, #1A1520 100%);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
a { color: inherit; }

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

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -60px; left: 16px; background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: var(--radius-sm); z-index: 2000; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.container { max-width: 1180px; margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 90px; }
.section--alt { background: var(--bg-alt); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.centered { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 1.02rem; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }

/* ---------------------------------------------------------------------- */
/* Top bar                                                                  */
/* ---------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; background: var(--surface);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; }
.brand__mark { width: 30px; height: 30px; color: var(--accent); }
.topbar__actions { display: flex; align-items: center; gap: 14px; }
.status-pill {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(30,142,90,0.18); }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text); transition: transform 0.3s var(--ease);
}
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle svg { width: 19px; height: 19px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                     */
/* ---------------------------------------------------------------------- */
.hero { background: var(--hero-gradient); padding-block: 74px 90px; }
.hero__inner { max-width: 980px; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-bottom: 18px; }
.hero__lead { color: var(--text-dim); font-size: 1.08rem; max-width: 760px; margin-bottom: 28px; }

.notice {
  display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 22px; margin-bottom: 44px; backdrop-filter: blur(10px);
}
.notice svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.notice p { font-size: 0.94rem; color: var(--text-dim); }

/* ---------------------------------------------------------------------- */
/* Vote cards — perfectly symmetric, no per-side styling                   */
/* ---------------------------------------------------------------------- */
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 22px; }

.vote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; backdrop-filter: blur(12px); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  display: flex; flex-direction: column; align-items: center;
}
.vote-card:hover { transform: translateY(-4px); }

.vote-card__flag {
  width: 96px; height: 64px; border-radius: 6px; overflow: hidden; margin-bottom: 18px;
  border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.vote-card__flag svg { width: 100%; height: 100%; }

.vote-card__name { font-size: 1.2rem; margin-bottom: 22px; }

.vote-btn {
  width: 100%; padding: 14px 20px; border-radius: 999px; font-weight: 700; font-size: 0.96rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 10px 24px rgba(52, 87, 213, 0.28); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
  margin-bottom: 24px;
}
.vote-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(52, 87, 213, 0.36); }
.vote-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.vote-btn.is-selected { outline: 3px solid var(--success); outline-offset: 2px; }

.vote-card__stats { width: 100%; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; padding-block: 6px; }
.stat-line__label { font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.stat-line__value { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.progress-track { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width 0.8s var(--ease); }

.vote-card__voted-msg {
  margin-top: 16px; font-size: 0.82rem; font-weight: 600; color: var(--success);
  display: flex; align-items: center; gap: 6px; justify-content: center;
}
.vote-card__voted-msg::before { content: '✓'; }

.vote-status { text-align: center; color: var(--text-dim); font-size: 0.92rem; }

/* ---------------------------------------------------------------------- */
/* Summary row / results                                                    */
/* ---------------------------------------------------------------------- */
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 48px; }
.summary-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; text-align: center; box-shadow: var(--shadow);
}
.summary-card__label { display: block; font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 10px; }
.summary-card__value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow);
}
.chart-card--wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: 1rem; margin-bottom: 18px; color: var(--text-dim); font-weight: 600; }
.chart-wrap { position: relative; height: 260px; }
.chart-card--wide .chart-wrap { height: 300px; }

/* ---------------------------------------------------------------------- */
/* Dashboard stat cards                                                     */
/* ---------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.dash-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 22px; text-align: center; backdrop-filter: blur(10px); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}
.dash-card:hover { transform: translateY(-4px); }
.dash-card__icon {
  width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.dash-card__icon svg { width: 22px; height: 22px; }
.dash-card__value { display: block; font-size: 1.9rem; font-weight: 800; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.dash-card__label { font-size: 0.85rem; color: var(--text-dim); }

/* ---------------------------------------------------------------------- */
/* Methodology / privacy                                                    */
/* ---------------------------------------------------------------------- */
.method-list li { padding-block: 14px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.96rem; }
.method-list li:first-child { border-top: none; }
.method-list strong { color: var(--text); }

.privacy-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow);
}
.privacy-card h3 { font-size: 1.05rem; margin-bottom: 18px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; padding-block: 10px; font-size: 0.92rem; color: var(--text-dim); }
.privacy-list svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* FAQ                                                                      */
/* ---------------------------------------------------------------------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-block: 20px; text-align: left; font-weight: 600; font-size: 1rem;
}
.faq-icon { width: 20px; height: 20px; position: relative; flex-shrink: 0; }
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; background: var(--accent); border-radius: 2px; top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.faq-icon::before { width: 13px; height: 2px; }
.faq-icon::after { width: 2px; height: 13px; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.faq-item.is-open .faq-icon::after { transform: translate(-50%,-50%) rotate(90deg); opacity: 0; }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.faq-item__a p { padding-bottom: 20px; color: var(--text-dim); font-size: 0.94rem; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-block: 40px; }
.footer__disclaimer {
  font-size: 0.88rem; color: var(--text-dim); max-width: 900px; margin-bottom: 24px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--text-dim); }

/* ---------------------------------------------------------------------- */
/* Animation utility                                                        */
/* ---------------------------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                               */
/* ---------------------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .section { padding-block: 60px; }
  .vote-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar__inner { height: 68px; }
  .status-pill span:not(.status-dot) { display: none; }
  .footer__bottom { flex-direction: column; }
}
