/* =========================================================
   00 — BASE / FONDATIONS
   ========================================================= */

/* === Polices personnalisées de Key Muller === */

/* --- Titres (H1, H2) : Sunlight Italic --- */
@font-face {
  font-family: 'Sunlight';
  src: url('../fonts/sunlight-italic-webfont.woff2') format('woff2'),
       url('../fonts/sunlight-italic-webfont.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* --- Texte courant (Regular) : Athauss Retina --- */
@font-face {
  font-family: 'Athauss';
  src: url('../fonts/athauss-retina-webfont.woff2') format('woff2'),
       url('../fonts/athauss-retina-webfont.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Texte italique : Athauss Retina Italic --- */
@font-face {
  font-family: 'Athauss';
  src: url('../fonts/athauss-retinaitalic-webfont.woff2') format('woff2'),
       url('../fonts/athauss-retinaitalic-webfont.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* --- Texte gras : Athauss Semibold --- */
@font-face {
  font-family: 'Athauss';
  src: url('../fonts/athauss-semibold-webfont.woff2') format('woff2'),
       url('../fonts/athauss-semibold-webfont.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Texte gras italique : Athauss Semibold Italic --- */
@font-face {
  font-family: 'Athauss';
  src: url('../fonts/athauss-semibolditalic-webfont.woff2') format('woff2'),
       url('../fonts/athauss-semibolditalic-webfont.woff') format('woff');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* === Application des polices === */
body, p, li, a, span {
  font-family: 'Athauss', sans-serif;
  font-weight: 400;
}

strong, b { font-weight: 600; }

h1, h2 {
  font-family: 'Sunlight', serif;
  font-style: italic;
  letter-spacing: -0.5px;
}

h3, h4 {
  font-family: 'Athauss', sans-serif;
  font-weight: 600;
}

/* =========================================================
   01 — HELPERS / PETITES REGLES GLOBALES
   ========================================================= */

/* Curseur custom (uniquement sur projet) */
.cursor-cta-on .project { cursor: pointer; }
#cursor-cta { will-change: transform, opacity; }

/* Nav link indicator (désactivé) */
.nav-link::after {
  display: none !important;
  height: 1px;
  width: 14px;
  background-color: rgba(0,0,0,0.2);
  bottom: 0;
}

/* =========================================================
   02 — COMPONENTS (réutilisables)
   ========================================================= */

/* ---------- Work preview (home / section projet) ---------- */
#workPreview {
  transition: opacity .2s ease, transform .25s ease;
}
#workPreviewImg {
  transition: opacity .2s ease;
}

/* ---------- Theme toggle (dark mode switch) ---------- */
.theme-toggle {
  width: 55px;
  height: 28px;
  background-color: #ffffff;
  border-radius: 9999px;
  padding: 3px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Variante violette (pages "de base") */
.darklightmodeviolet .theme-toggle {
  background-color: #c0a9ff;
}

/* Pastille */
.toggle-thumb {
  width: 20px;
  height: 20px;
  background-color: #000000;
  border-radius: 50%;
  position: relative;
  z-index: 3;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Icônes */
.theme-toggle img {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

/* Étoile gauche */
.icon-stars {
  left: 7px;
  filter: brightness(0) invert(1);
  opacity: 0;
}

/* Soleil droite */
.icon-sun {
  right: 7px;
  opacity: 1;
}

/* --- Etat dark du toggle --- */
.theme-toggle.active { background-color: #2c2b2d; }
.theme-toggle.active .toggle-thumb {
  transform: translateX(27px);
  background-color: #ffffff;
}
.theme-toggle.active .icon-sun { opacity: 0; }
.theme-toggle.active .icon-stars { opacity: 1; }

/* ---------- Footer (global) ---------- */
.footer-shape { fill: #2c2b2d; } /* light */
body.dark-mode .footer-shape { fill: #cfff73 !important; }
body.dark-mode .footer-icon i { color: #cfff73 !important; }

/* =========================================================
   03 — DARK MODE GLOBAL (règles générales)
   ========================================================= */

body.dark-mode p,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode li {
  color: white;
}

body.dark-mode:not(nav) {
  background-color: #2c2b2d;
}

/* Exceptions : boutons "type de projet" restent noirs */
body.dark-mode .project-type-btn,
body.dark-mode .project-type-btn span {
  color: #2c2b2d !important;
}

/* Exceptions : liens nav restent noirs */
body.dark-mode #site-nav .nav-link { color: #2c2b2d !important; }
body.dark-mode #nav-panel a { color: #2c2b2d !important; }

/* =========================================================
   04 — PAGES
   ========================================================= */

/* ===========================
   04.1 — HOME PAGE
   =========================== */

/* HERO background */
.hero-bg { background-color: #c0a9ff; }
body.dark-mode .hero-bg {
  background-color: rgba(69, 55, 118, 0.85);
}

/* Footer gradient (home / global footer) */
body:not(.dark-mode) footer {
  background-image: linear-gradient(to bottom, transparent 0%, #c0a9ff 100%);
}
body.dark-mode footer {
  background-image: linear-gradient(to bottom, transparent 0%, rgba(69, 55, 118, 0.85) 100%) !important;
}

/* Croix footer */
body:not(.dark-mode) footer img[src*="small_cross.svg"] { filter: invert(1); }
body.dark-mode footer img[src*="small_cross.svg"] {
  filter: none;
  opacity: 0.35;
}

/* Texte flouté hover (work list) */
body.dark-mode #work-original .project {
  color: white !important;
}
body.dark-mode #work-original .group:hover .project:not(:hover) {
  color: rgba(69, 55, 118, 0.85) !important;
}

/* ===========================
   04.2 — CONTACT / "WORK WITH ME"
   =========================== */

/* --- DARK mode specific page contact --- */
body.dark-mode .contact-page { background-color: #2c2b2d; }

body.dark-mode .contact-card {
  background-color: #2c2b2d;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .contact-page h1,
body.dark-mode .contact-page p,
body.dark-mode .contact-page label,
body.dark-mode .contact-page span {
  color: #ffffff;
}

body.dark-mode .contact-page a { color: #cfff73; }

body.dark-mode .contact-page input,
body.dark-mode .contact-page textarea {
  background-color: #2c2b2d;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .contact-page input::placeholder,
body.dark-mode .contact-page textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* --- Styles composants de la page (light & dark inclus dans les styles) --- */
.service-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background-color: #2c2b2d;
  color: white;
  font-family: 'Athauss';
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.service-btn:hover {
  background-color: #3b3a3c;
  transform: translateY(-2px);
}

.contact-input {
  width: 100%;
  padding: 14px 18px;
  background-color: #1f1e21;
  border-radius: 14px;
  outline: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  font-family: 'Athauss';
  transition: border-color 0.2s ease;
}

.contact-input::placeholder { color: rgba(255,255,255,0.4); }
.contact-input:focus { border-color: #cfff73; }

/* ===========================
   04.3 — PROJECT PAGES
   =========================== */

/* --- Footer pages projet --- */
#project-footer .proj-footer-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  transition: transform 0.15s ease;
  color: #2c2b2d;
}

#project-footer .proj-footer-icon:hover {
  transform: scale(1.15);
}

#project-footer .proj-footer-icon::after {
  content: attr(data-social);
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  background: #cfff73;
  color: #2c2b2d;
  font-family: 'Athauss';
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#project-footer .proj-footer-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}

/* Dark: pastille reste verte + icônes blanches */
body.dark-mode #project-footer .proj-footer-icon::after {
  background: #cfff73;
  color: #2c2b2d;
}
body.dark-mode #project-footer .proj-footer-icon i {
  color: white;
}

/* --- Nav projet (prev/next) --- */
body.dark-mode #project-nav a {
  background-color: #2c2b2d !important;
  color: white !important;
}
body.dark-mode #project-nav a img { filter: invert(1); }
body.dark-mode #project-nav a:hover { background-color: #c0a9ff !important; }
body:not(.dark-mode) #project-nav a:hover { background-color: #cfff73 !important; }

/* --- Accordéon projet (dl/dt/dd) --- */
body.dark-mode #readmore-panel dd { color: #ffffff !important; }
body.dark-mode #readmore-panel dt { color: rgba(255, 255, 255, 0.6) !important; }
body.dark-mode #readmore-panel .prose,
body.dark-mode #readmore-panel .prose * { color: #ffffff !important; }

/* --- Bouton "Détails du projet" --- */
body.dark-mode #readmore-toggle { color: #ffffff !important; }
body.dark-mode #readmore-toggle span { color: #ffffff !important; }
body.dark-mode #readmore-toggle img { filter: invert(1); }

/* ===========================
   04.4 — GRADIENTS (UTILS / tailwind overrides)
   =========================== */

/* Sections gradient (from violet vers transparent) */
body:not(.dark-mode) [class*="from-[#c0a9ff]"]:not(footer) {
  background-image: linear-gradient(to bottom, #c0a9ff 0%, transparent 100%);
}

body.dark-mode [class*="from-[#c0a9ff]"]:not(footer) {
  background-image: linear-gradient(
    to bottom,
    rgba(69, 55, 118, 0.85) 0%,
    transparent 100%
  );
}

/* Footer gradient inversé (transparent vers violet) */
body:not(.dark-mode) footer[class*="from-[#c0a9ff]"] {
  background-image: linear-gradient(to top, transparent 0%, #c0a9ff 100%);
}

body.dark-mode footer[class*="from-[#c0a9ff]"] {
  background-image: linear-gradient(to top, transparent 0%, rgba(69, 55, 118, 0.6) 100%);
}

/* =========================================================
   05 — FORMS / BUTTONS divers (si tu veux les garder à part)
   ========================================================= */

/* Boutons "type de projet" */
.project-type-btn { cursor: pointer; }
.project-type-btn {
  font-size: 0.9rem;
  padding: 6px 14px;
}
.project-type-btn.active {
  background-color: #cfff73 !important;
  border-color: #2c2b2d !important;
}
