/* ==========================================================================
   1. VARIABLES & RESET BASE
   ========================================================================== */
:root {
  --bg-color: #0d0d0d;
  --text-color: #e6e6e6;
  --accent-color: #ffffff;
  --border-color: #333333;
  
  --font-title: 'Syne Mono', monospace;
  --font-body: 'Cutive Mono', monospace;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  position: relative;
}

/* Background Bauhaus overlay */
.bg-cover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('bauhaus.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.08;
  filter: grayscale(100%) blur(10px);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   2. LAYOUT COMMON
   ========================================================================== */
.container {
  width: 100%;
  max-width: 800px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.page-content {
  margin: 3rem 0;
}

.page-heading {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1.6rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--accent-color);
}

.section-intro {
  margin-bottom: 2rem;
  opacity: 0.8;
  line-height: 1.5;
}

/* Header */
.site-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  text-align: center;
}

.site-title {
  font-family: var(--font-title);
  font-size: 3rem;
  letter-spacing: 0.08em;
}

.home-title {
  font-family: var(--font-title);
  font-size: 3rem;
  letter-spacing: 0.08em;
}

.intro-name {
    text-align: center;
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.intro {
text-align: center;
}

/* ==========================================================================
   NAVIGATION MATRICIELLE 2x2
   ========================================================================== */
.matrix-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 3.5rem auto 0 auto;
  max-width: 520px;
}

/* Structure des crochets mathématiques */
.bracket {
  width: 14px;
  align-self: stretch; /* Le crochet s'étire sur toute la hauteur de la matrice */
  border: 2px solid var(--text-color);
}

.left-bracket {
  border-right: none;
}

.right-bracket {
  border-left: none;
}

/* Grille 2x2 interne */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem 2.5rem; /* Espace vertical et horizontal entre les éléments */
  padding: 0.8rem 0;
}

/* Liens / Éléments de la matrice */
.matrix-item {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-color);
  text-decoration: none;
  text-align: center;
  padding: 0.8rem 1.2rem;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

/* Effet Hover au survol d'une valeur de la matrice */
.matrix-item:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.matrix-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.matrix-item .item-text {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.matrix-item .calc-stream {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-color);
  color: inherit; /* Couleur du texte pendant le calcul */
  pointer-events: none;
}

/* Adaptatif pour mobile */
@media (max-width: 500px) {
  .matrix-container {
    gap: 0.8rem;
  }
  
  .matrix-grid {
    gap: 1rem 1.2rem;
  }

  .matrix-item {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }
}

/* Footer & Sub-nav */
.sub-nav {
  margin-top: 3rem;
}

.btn-back {
  font-family: var(--font-body);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-back:hover {
  text-decoration: underline;
}

/* ==========================================================================
   3. PAGE : ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.portrait-container {
  width: 100%;
}

.portrait-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--text-color);
  filter: grayscale(100%) contrast(120%);
}

.portrait-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border: 1px dashed var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  opacity: 0.6;
}

.bio-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.bio-text strong {
  color: #fff;
}

.contact-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.contact-box a {
  color: var(--text-color);
}

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.social-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  /* Rend l'image blanche si ton PNG est noir par défaut */
  filter: invert(100%); 
  transition: opacity 0.2s ease;
}

.social-img:hover {
  opacity: 0.7;
}

/* Section /NOW dans About */
.now-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

.now-timestamp {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.now-text {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

.now-text strong {
  color: var(--accent-color);
}

/* ==========================================================================
   4. PAGE : PORTFOLIO
   ========================================================================== */
.portfolio-section {
  margin-bottom: 3.5rem;
}

.cv-intro {
  margin-bottom: 1rem;
}

.cv-downloads {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn-cv {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-cv:hover {
  text-decoration: underline;
}

/* Style si tu utilises des images PNG */
.flag-img {
  width: 20px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.project-card {
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
}

.project-title {
  font-family: var(--font-body);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.wasm-container,
.iframe-container {
  width: 100%;
  border: 1px dashed var(--border-color);
  margin-top: 1rem;
}

.demo-placeholder {
  padding: 2rem;
  text-align: center;
  font-family: var(--font-body);
  opacity: 0.5;
  font-size: 0.85rem;
}

.iframe-container iframe {
  display: block;
  background: #fff;
}

.projects-link-container {
  margin-top: 1rem;
}

.projects-link-container .btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: all 0.2s ease;
}

.projects-link-container .btn:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.portfolio-section {
  margin-bottom: 2.5rem;
}

.portfolio-section .section-title {
  margin-bottom: 1.2rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.4rem;
}

/* ==========================================================================
   5. PAGE : BLOG
   ========================================================================== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-item {
  border-left: 2px solid var(--border-color);
  padding-left: 1.2rem;
}

.post-meta {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.8rem;
}

.post-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-excerpt {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ==========================================================================
   6. PAGE : CURATION
   ========================================================================== */
.curation-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.curation-item {
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 1rem;
}

.curation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.curation-title {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
}

.curation-title:hover {
  text-decoration: underline;
}

.curation-date {
  font-size: 0.85rem;
  opacity: 0.5;
}

.curation-details {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.3rem;
}

/* PROJECTS */

.project-links {
  margin-top: 0.8rem;
}

.project-link {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.6;
  text-decoration: underline;
}

/* ==========================================================================
   7. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 650px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}
