:root {
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;

  --shadow: 0 18px 60px rgba(0,0,0,0.28);

  --primary: #2DD4BF;
  --primary-deep: #0F766E;
  --accent: #60A5FA;
  --warn: #F59E0B;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 140ms;
  --t-med: 220ms;
}

/* Default theme is dark */
:root[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111B2E;
  --surface2: #16233A;
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface2: #EEF2F9;
  --border: rgba(15,23,42,0.12);
  --text: rgba(15,23,42,0.92);
  --muted: rgba(15,23,42,0.70);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Instrument Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Banner */
.banner {
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--muted);
}
.banner strong { color: var(--text); }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
}

.menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item { position: relative; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.link:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.link:active { transform: translateY(1px); }

.dropdown {
  display: none;
  position: absolute;
  top: 46px;
  left: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dropdown a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--muted);
}

.dropdown a:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.item:hover .dropdown { display: block; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #071018;
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}

.btn-primary:hover { filter: brightness(0.98); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0px); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0px); }

/* Page layout */
.wrap { width: min(1100px, 92vw); margin: 0 auto; padding: 22px 0 48px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
}

/* Tiles */
.grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.tile {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}

.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.tile .img {
  height: 170px;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform var(--t-med) var(--ease);
}

.tile:hover .img { transform: scale(1.05); }

.tile .meta { padding: 14px; }
.tile .meta p { margin: 0; color: var(--muted); line-height: 1.45; }
.tile .meta h3 { margin: 0 0 6px; }

footer {
  border-top: 1px solid var(--border);
  padding: 18px 16px;
  color: var(--muted);
}

footer .row {
  width: min(1100px, 92vw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Theme toggle slider (CSS-only labels, no JS needed) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.theme-toggle:active { transform: translateY(1px); }

.theme-toggle .label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.theme-toggle .track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.theme-toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--primary);
  transition: transform var(--t-med) var(--ease);
}

:root[data-theme="light"] .theme-toggle .thumb {
  transform: translateX(20px);
}

/* Label highlighting based on current theme */
:root[data-theme="dark"] .theme-toggle .label-dark { color: var(--text); }
:root[data-theme="dark"] .theme-toggle .label-light { color: var(--muted); }

:root[data-theme="light"] .theme-toggle .label-dark { color: var(--muted); }
:root[data-theme="light"] .theme-toggle .label-light { color: var(--text); }

/* Language toggle (English / Français) */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.lang-toggle a {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 7px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.lang-toggle a:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

.lang-toggle a:active { transform: translateY(1px); }

.lang-toggle a.active {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
}

/* ===== Landing hero ===== */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 340px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  transform: scale(1.02);
}

/* Dark mode overlay (keeps the left side readable) */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(11,18,32,0.90) 0%,
    rgba(11,18,32,0.60) 42%,
    rgba(11,18,32,0.18) 72%,
    rgba(11,18,32,0.00) 100%
  );
}

/* Light mode: stronger overlay to avoid "white washed" look */
:root[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.92) 0%,
    rgba(255,255,255,0.72) 40%,
    rgba(255,255,255,0.32) 70%,
    rgba(255,255,255,0.00) 100%
  );
}

/* Light mode: subtle contrast recovery (keeps it clinical, not edited) */
:root[data-theme="light"] .hero-bg {
  filter: contrast(1.06) saturate(0.96);
}

.hero-content {
  position: relative;
  padding: 46px 26px;
  width: min(640px, 92%);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 40px;
  letter-spacing: 0.2px;
}

.hero p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.btn-secondary:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0px); }

/* Slide-up animation */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise-1 { animation: riseIn 650ms var(--ease) both; }
.rise-2 { animation: riseIn 650ms var(--ease) both; animation-delay: 120ms; }
.rise-3 { animation: riseIn 650ms var(--ease) both; animation-delay: 220ms; }

@media (max-width: 800px) {
  .hero-content { padding: 34px 18px; }
  .hero h1 { font-size: 32px; }
  .tile { grid-column: span 12; }
}
