:root {
  --bg: #0d1117;
  --bg-light: #161b22;
  --text: #e6edf3;
  --accent: #00bfa6;
  --muted: #8b949e;
}

body.light {
  --bg: #f5f5f5;
  --bg-light: #ffffff;
  --text: #111;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  background: var(--bg);
  color: var(--text);
  transition: all 0.25s ease;
}

/* Reduce vertical whitespace between sections (≈ -60%) */
section {
  padding: 1.2rem 12%;
}

h1 { font-size: 3rem; margin: 0.6rem 0; }
h2 { font-weight: 300; color: var(--accent); margin: 0.4rem 0; }
h3 { color: var(--accent); margin: 0 0 0.55rem 0; }

section p { margin: 0.4rem 0; }

/* HERO */
.hero {
  text-align: center;
  padding-top: 5.5rem;
}

.avatar {
  width: 60%;
  max-width: 120px;
  margin-bottom: 0.9rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(0, 191, 166, 0.35));
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* BUTTONS */
.buttons .btn {
  margin: 0.35rem;
  padding: 0.62rem 1.25rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  transition: 0.22s;
  border-radius: 10px;
  background: transparent;
}

.buttons .btn:hover {
  background: var(--accent);
  color: #000;
}

/* Full green CTA */
.buttons .btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.buttons .btn.primary:hover {
  filter: brightness(0.95);
}

/* TAGS */
.tags span {
  background: var(--bg-light);
  padding: 0.4rem 0.8rem;
  margin: 0.25rem;
  display: inline-block;
  transition: 0.22s;
  border-radius: 10px;
}

.tags span:hover {
  background: var(--accent);
  color: #000;
}

/* TIMELINE */
.timeline {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
}

.timeline .item {
  margin-bottom: 0.8rem;
}

/* PROJECTS */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem; /* reduced spacing */
}

/* When a filter leaves only 1 project visible, keep it ~50% width and centered */
.projects.filtered-single {
  grid-template-columns: minmax(280px, 560px);
  justify-content: center;
}

.project-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 0.85rem;
  background: #000;
}

.project-card {
  background: var(--bg-light);
  padding: 1.15rem;
  border-left: 3px solid var(--accent);
  transition: transform 0.25s ease;
  border-radius: 14px;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card a {
  color: var(--accent);
  text-decoration: none;
}

.project-card a:hover {
  text-decoration: underline;
}

/* Filters */
.filters {
  margin-bottom: 0.6rem;
}

.filters button {
  margin-right: 0.4rem;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 10px;
}

/* CONTROLS */
.controls {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 9999;
}

.controls button {
  background: var(--bg-light);
  border: none;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  margin-left: 0.4rem;
  cursor: pointer;
  border-radius: 10px;
}

/* Callback form */
.callback-form {
  max-width: 640px;
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.form-row {
  display: grid;
  gap: 0.3rem;
}

.callback-form input,
.callback-form textarea {
  background: var(--bg-light);
  border: 1px solid rgba(0, 191, 166, 0.35);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  outline: none;
}

.callback-form input:focus,
.callback-form textarea:focus {
  border-color: var(--accent);
}

.callback-form button.btn.primary {
  width: fit-content;
  border: 0;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
}

/* CONTACT */
.contact p {
  margin: 0.25rem 0;
}

.contact a {
  color: var(--accent);
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

/* QR */
.qr {
  width: 120px;
  margin-top: 0.6rem;
}

/* MISC */
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* ANIMATIONS */
.fade {
  opacity: 0;
  transform: translateY(18px);
  transition: 0.55s ease;
}
.fade.show {
  opacity: 1;
  transform: translateY(0);
}

.quote { text-align: center; opacity: 0.85; }
.quote p { font-style: italic; }
.quote-mark { color: var(--accent); }

/* LANGUAGE SWITCH */
body:not(.lang-en) .en { display: none; }
body.lang-en .fr { display: none; }
