/* Joan Mouba — portfolio */
:root {
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-muted: #e8eef6;
  /* Section backgrounds — distinct bands down the page */
  --bg-hero: linear-gradient(165deg, #cfe2f5 0%, #e8f2fb 45%, #dceaf8 100%);
  --bg-about: #faf7f2;
  --bg-skills: #ebe7f3;
  --bg-projects: #e8f5f0;
  --bg-parcours: #e2eaf5;
  --bg-contact: linear-gradient(180deg, #d2e3f5 0%, #b8d0ea 100%);
  --bg-footer: #1b2838;
  --color-text: #1a2744;
  --color-text-soft: #4a5d78;
  --color-accent: #1e4a7a;
  --color-accent-light: #3d7ab8;
  --color-accent-soft: rgba(30, 74, 122, 0.12);
  --shadow-sm: 0 4px 20px rgba(26, 39, 68, 0.08);
  --shadow-md: 0 12px 40px rgba(26, 39, 68, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --header-h: 72px;
}

[data-theme="dark"] {
  --color-bg: #0f1622;
  --color-surface: #152033;
  --color-muted: #1a2538;
  --bg-hero: linear-gradient(165deg, #102338 0%, #152d44 45%, #1b3853 100%);
  --bg-about: #121c2b;
  --bg-skills: #172334;
  --bg-projects: #132831;
  --bg-parcours: #162133;
  --bg-contact: linear-gradient(180deg, #1a2a40 0%, #122033 100%);
  --bg-footer: #0b1019;
  --color-text: #e5edf8;
  --color-text-soft: #b8c7dc;
  --color-accent: #7cb8ff;
  --color-accent-light: #9ac9ff;
  --color-accent-soft: rgba(124, 184, 255, 0.2);
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--bg-about);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent-light);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(1100px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 74, 122, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  min-height: var(--header-h);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--color-accent);
  text-decoration: none;
  margin-right: auto;
}

/* Language switch (EN · United Kingdom, DE · Germany) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 74, 122, 0.2);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lang-btn:hover {
  background: var(--color-accent-soft);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lang-btn--active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(30, 74, 122, 0.2);
}

.lang-btn .flag {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
}

.lang-btn__code {
  min-width: 1.5ch;
}

[data-theme="dark"] .lang-switch {
  border-color: rgba(124, 184, 255, 0.25);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(30, 74, 122, 0.24);
  background: var(--color-surface);
  color: var(--color-accent);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  background: var(--color-accent-soft);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle-icon--moon {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon--sun {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon--moon {
  display: inline;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.site-header.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(30, 74, 122, 0.1);
    padding: 1rem 1.25rem 1.5rem;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.25s;
  }

  .site-header.is-open .nav {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Hero */
.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
  background:
    radial-gradient(ellipse 80% 55% at 100% 0%, rgba(61, 122, 184, 0.28), transparent),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(30, 74, 122, 0.14), transparent),
    var(--bg-hero);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    max-width: 360px;
    margin-inline: auto;
  }
}

.hero-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--color-text-soft);
  max-width: 36ch;
}

@media (max-width: 900px) {
  .hero-lead {
    max-width: none;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.hero-note {
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-accent);
  margin: 0;
}

.hero-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
  border: 1px solid rgba(30, 74, 122, 0.1);
}

.hero-img {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: #163a61;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border-color: rgba(30, 74, 122, 0.35);
}

.btn-ghost:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.btn-text {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover {
  color: var(--color-accent);
}

/* Sections */
.section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.section--muted {
  background: var(--color-muted);
}

#apropos {
  background: var(--bg-about);
}

#competences.section--muted {
  background: var(--bg-skills);
}

#projets {
  background: var(--bg-projects);
}

#parcours.section--muted {
  background: var(--bg-parcours);
}

.section-header {
  margin-bottom: 2.25rem;
  max-width: 640px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.section-intro {
  margin: 0;
  color: var(--color-text-soft);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 280px;
    margin-inline: auto;
  }
}

.about-text p {
  margin: 0 0 1.25rem;
  color: var(--color-text-soft);
}

.about-facts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-facts li {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(30, 74, 122, 0.12);
  font-size: 0.95rem;
  color: var(--color-text);
}

.about-facts li > span:first-child {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
}

.about-facts-text {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text);
}

.about-photo {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(30, 74, 122, 0.1);
}

.about-photo img {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 2 / 3;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skill-card {
  background: var(--color-surface);
  padding: 1.5rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(30, 74, 122, 0.1);
  box-shadow: var(--shadow-sm);
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--color-accent);
}

.skill-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: var(--color-surface);
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 74, 122, 0.1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.project-card-icon {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(30, 74, 122, 0.2);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.project-card > p {
  margin: 0 0 1rem;
  flex: 1;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.project-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 500;
}

.project-meta li + li {
  margin-top: 0.25rem;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--color-accent-soft);
  padding-left: 1.75rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.75rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 7px);
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

#parcours .timeline-item::before {
  border-color: var(--bg-parcours);
}

.timeline-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent-light);
  margin-bottom: 0.35rem;
}

.timeline-item h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.timeline-item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* Contact */
.contact-section {
  text-align: center;
  background: var(--bg-contact);
}

.contact-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  margin: 0 0 0.75rem;
}

.contact-lead {
  margin: 0 0 1.25rem;
  color: var(--color-text-soft);
}

.contact-details {
  font-style: normal;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.contact-details a {
  font-weight: 600;
}

.contact-sep {
  margin: 0 0.5rem;
  color: var(--color-text-soft);
}

.contact-address {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

.contact-cv .btn {
  text-decoration: none;
}

/* Footer */
.site-footer {
  padding: 1.5rem 0 2rem;
  background: var(--bg-footer);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.site-footer .btn-text {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer .btn-text:hover {
  color: #fff;
}

/* Visually hidden (accessible labels) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ask Joan chat */
.ask-joan {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.ask-joan > * {
  pointer-events: auto;
}

.ask-joan-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.65rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.2s, transform 0.15s;
}

.ask-joan-fab:hover {
  background: #163a61;
}

[data-theme="dark"] .ask-joan-fab:hover {
  background: #5a9ee6;
}

.ask-joan-fab:active {
  transform: scale(0.98);
}

.ask-joan-fab-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.ask-joan-fab-label {
  max-width: 11rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .ask-joan-fab-label {
    display: none;
  }

  .ask-joan-fab {
    padding: 0.65rem 0.85rem;
  }
}

.ask-joan-panel {
  width: min(100vw - 2rem, 400px);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid rgba(30, 74, 122, 0.15);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.ask-joan-panel[hidden] {
  display: none !important;
}

.ask-joan-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

.ask-joan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(30, 74, 122, 0.1);
  background: var(--color-muted);
}

.ask-joan-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-accent);
}

.ask-joan-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ask-joan-close:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.ask-joan-intro {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-text-soft);
  border-bottom: 1px solid rgba(30, 74, 122, 0.08);
}

.ask-joan-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.92rem;
}

.ask-joan-msg {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  max-width: 92%;
  line-height: 1.5;
  word-wrap: break-word;
}

.ask-joan-msg--user {
  align-self: flex-end;
  background: var(--color-accent);
  color: #fff;
  margin-left: 2rem;
}

.ask-joan-msg--assistant {
  align-self: flex-start;
  background: var(--color-muted);
  color: var(--color-text);
  border: 1px solid rgba(30, 74, 122, 0.1);
  margin-right: 0.5rem;
}

.ask-joan-msg--thinking {
  font-style: italic;
  color: var(--color-text-soft);
}

.ask-joan-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(30, 74, 122, 0.1);
  background: var(--color-surface);
}

.ask-joan-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 3.25rem;
  max-height: 8rem;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid rgba(30, 74, 122, 0.22);
  background: var(--color-bg);
  color: var(--color-text);
}

.ask-joan-form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.ask-joan-form textarea:disabled {
  opacity: 0.65;
}

.ask-joan-send {
  align-self: flex-end;
}
