/* ==========================================================================
   Josselin Robert — Academic Light Mode Portfolio
   ========================================================================== */

:root {
  --bg-page: #fcfcfb;
  --bg-card: #ffffff;
  --bg-subtle: #f4f4f0;
  --border-light: #e4e4de;
  --border-strong: #c8c8c0;
  --text-primary: #1a1a1a;
  --text-secondary: #424750;
  --text-muted: #6b7280;
  --accent-navy: #182b49;
  --accent-navy-light: #eef2f6;
  --wordle-gray: #3a3a3c;
  --wordle-border: #565758;
  --wordle-green: #538d4e;
  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-wordle: 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}

/* --- Centered Hero & Wordle Top Stage --- */
.hero-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}

.avatar-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.35rem;
}

.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: block;
}

/* Post-It isolated on the right */
.post-it-note {
  position: absolute;
  left: calc(50% + 175px);
  top: 15px;
  width: 228px;
  height: 216px;
  background: url('./src/postit.png') center / contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.post-it-content {
  font-family: 'Caveat', cursive;
  transform: rotate(-4.5deg);
  padding: 24px 22px 10px;
  text-align: center;
  color: #242014;
  width: 100%;
}

.post-it-heading {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  color: #1c1910;
}

.post-it-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.24;
  color: #262216;
  text-align: center;
}

.post-it-list li {
  margin-bottom: 0.12rem;
}

.post-it-list li:last-child {
  margin-bottom: 0;
}

.wordle-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  perspective: 900px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  user-select: none;
}

.lettersrow {
  display: flex;
  gap: 8px;
  transition: all 0.8s ease;
}

.animateCenter {
  transform: translateX(29px);
}

.card {
  height: 50px;
  width: 50px;
  position: relative;
  transform-style: preserve-3d;
  transition: all 0.8s ease;
  display: grid;
  place-items: center;
}

.front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--wordle-gray);
  border: 2px solid var(--wordle-border);
  color: #ffffff;
  font-family: var(--font-wordle);
  font-weight: 700;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 2px;
}

.back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--wordle-green);
  color: #ffffff;
  font-family: var(--font-wordle);
  font-weight: 700;
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotateX(180deg);
  border-radius: 2px;
}

.g-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--bg-page);
  text-align: center;
  transform: rotateX(180deg);
}

.card h1 {
  font-size: 1.4rem;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.02em;
}

.flipCard {
  transform: rotateX(180deg);
}

.hero-name {
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.status-badge-container {
  margin-bottom: 0.65rem;
  position: relative;
  display: inline-block;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ffffff;
  background-color: var(--accent-navy);
  border: 1px solid var(--accent-navy);
  padding: 0.24rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.status-badge:hover,
.status-badge:focus {
  background-color: #101e34;
  border-color: #101e34;
  box-shadow: 0 2px 8px rgba(24, 43, 73, 0.25);
}

.status-badge-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 290px;
  background-color: #1b1f24;
  color: #f0f3f6;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  text-align: center;
}

.status-badge-tooltip strong {
  font-family: var(--font-serif);
  font-weight: 600;
  color: #ffffff;
}

.status-badge-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #1b1f24 transparent;
}

.status-badge:hover .status-badge-tooltip,
.status-badge:focus .status-badge-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero-affiliation {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-bio {
  font-size: 1.06rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.hero-etymology {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
}

.about-me-box {
  margin-bottom: 1.4rem;
  text-align: left;
  display: inline-block;
}

.about-me-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  text-align: center;
}

.about-me-list {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.96rem;
  color: var(--text-secondary);
}

.about-me-list li {
  margin-bottom: 0.15rem;
}

.inline-link {
  color: var(--accent-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--accent-navy);
  background-color: var(--bg-card);
  text-decoration: none;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--accent-navy);
  color: #ffffff;
  background-color: var(--accent-navy);
  box-shadow: 0 2px 8px rgba(24, 43, 73, 0.2);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background-color: var(--bg-card);
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--accent-navy);
  color: var(--accent-navy);
  background-color: var(--accent-navy-light);
}

.btn-primary {
  background-color: var(--accent-navy);
  color: #ffffff;
  border-color: var(--accent-navy);
}

.btn-primary:hover {
  background-color: #101e34;
  color: #ffffff;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Section Headings --- */
.section-block {
  margin-top: 3rem;
}

.section-header {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.3rem 0.7rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-btn.active {
  background-color: var(--accent-navy);
  color: #ffffff;
  border-color: var(--accent-navy);
}

/* --- 2-Column Snake Grid with Outer U-Turn Loops --- */
.projects-zigzag {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 3.6rem;
  row-gap: 2.1rem;
  padding: 0.5rem 2.6rem;
}

.zigzag-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

#zigzag-path {
  fill: none;
  stroke: var(--accent-navy);
  stroke-width: 2.4px;
  stroke-dasharray: 1 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.68;
}

#zigzag-arrows {
  fill: none;
  stroke: var(--accent-navy);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.project-card {
  position: relative;
  z-index: 2;
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  border-color: var(--accent-navy);
  box-shadow: 0 4px 14px rgba(26, 46, 76, 0.06);
}

/* Reactif Card: Medical Cyan / Electric Blue theme gradient */
.project-card.card-reactif {
  background: linear-gradient(145deg, #f0f7ff 0%, #e2efff 65%, #d4e7fe 100%);
  border-color: #bad6fa;
}

.project-card.card-reactif:hover {
  border-color: #007dff;
  box-shadow: 0 6px 18px rgba(0, 125, 255, 0.14);
}

.project-card.card-reactif .project-title {
  color: #004b99;
}

.project-card.card-reactif .project-desc {
  color: #1e3a5f;
}

.project-card.card-reactif .project-date-label {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: #b3d4fc;
  color: #0066cc;
}

.project-card.card-reactif .project-footer {
  border-top-color: #bad6fa;
}

.project-card.card-reactif .tech-tag {
  background-color: rgba(255, 255, 255, 0.85);
  color: #004b99;
}

.project-card.card-reactif .tech-tag:first-child {
  background-color: #0056ae;
  color: #ffffff;
  font-weight: 500;
}

.project-card.card-reactif .project-link {
  color: #0066cc;
  font-weight: 500;
}

/* yNotes Card: Midnight Indigo & Violet gradient */
.project-card.card-ynotes {
  background: linear-gradient(145deg, #f4f4fa 0%, #ebebf7 60%, #dedef0 100%);
  border-color: #cfd0e6;
}

.project-card.card-ynotes:hover {
  border-color: #4a4b8f;
  box-shadow: 0 6px 18px rgba(24, 36, 95, 0.12);
}

.project-card.card-ynotes .project-title {
  color: #18245f;
}

.project-card.card-ynotes .project-desc {
  color: #272c4e;
}

.project-card.card-ynotes .project-date-label {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: #c9cae3;
  color: #18245f;
}

.project-card.card-ynotes .project-footer {
  border-top-color: #cfd0e6;
}

.project-card.card-ynotes .tech-tag {
  background-color: rgba(255, 255, 255, 0.85);
  color: #18245f;
}

.project-card.card-ynotes .project-link {
  color: #18245f;
  font-weight: 500;
}

.project-card.hidden {
  display: none;
}

/* Top-Left Date Badge inside each Card (and Dot for Mobile Vertical Axis) */
.project-date-node {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.timeline-dot {
  display: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--accent-navy);
  border: 2px solid var(--bg-page);
  box-shadow: 0 0 0 1.5px var(--accent-navy);
  flex-shrink: 0;
}

.project-date-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-navy);
  background-color: var(--bg-subtle);
  padding: 0.14rem 0.48rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

.project-card-top {
  margin-bottom: 0.9rem;
}

.project-header-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.project-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.project-title {
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  background-color: var(--bg-subtle);
  padding: 0.12rem 0.42rem;
  border-radius: 2px;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent-navy);
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Academic & Professional Trajectory --- */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.timeline-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1rem 1.35rem;
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 1.1rem;
  align-items: start;
}

.timeline-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.1rem;
}

.timeline-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  padding: 3px;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.timeline-logo-link:hover {
  border-color: var(--accent-navy);
}

.timeline-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-navy);
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.timeline-org {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 0.25rem;
}

.timeline-org-link {
  color: inherit;
  text-decoration: none;
}

.timeline-org-link:hover {
  color: var(--accent-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.timeline-details {
  font-size: 0.93rem;
  color: var(--text-secondary);
}

/* --- Technical Scope Matrix --- */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.matrix-col {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.matrix-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-navy);
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.3rem;
  font-weight: 500;
}

.matrix-list {
  list-style: none;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.matrix-list li {
  margin-bottom: 0.35rem;
}

/* --- Footer --- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.15rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-navy);
  text-decoration: underline;
}

@media (max-width: 780px) {
  .post-it-note {
    display: none;
  }

  .projects-zigzag {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 1.25rem;
    padding: 0.5rem 0 0.5rem 28px;
  }

  .project-card,
  .project-card.zigzag-left,
  .project-card.zigzag-right {
    width: 100%;
  }

  .project-date-node {
    position: relative;
    margin-bottom: 0.55rem;
  }

  .timeline-dot {
    display: block;
    position: absolute;
    left: -45px;
    top: 50%;
    transform: translateY(-50%);
  }

  .matrix-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
