/*
  Portfolio Antoine Goossens - Styles CSS
  Minimal, clean portfolio theme
*/

:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --brand: #3b82f6;
  --brand-600: #2563eb;
  --surface: #f8fafc;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
}

.dark {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --brand: #60a5fa;
  --brand-600: #3b82f6;
  --surface: #0f172a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { 
  display: block; 
  max-width: 100%; 
  height: auto; 
}

.container { 
  width: min(1100px, 92%); 
  margin-inline: auto; 
}

.muted { 
  color: var(--muted); 
}

/* ==================== BACKSCREEN CANVAS ==================== */
.backscreen {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* ==================== HEADER (STICKY) ==================== */
.site-header {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 100;
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 14px 4%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dark .site-header {
  background: rgba(11, 18, 32, 0.95);
}

.logo { 
  font-weight: 700; 
  letter-spacing: 0.3px; 
  color: var(--text); 
  text-decoration: none;
  transition: color 0.2s ease;
}

.logo:hover { 
  color: var(--brand); 
}

.logo span { 
  color: var(--brand); 
}

.nav__toggle { 
  display: none; 
  font-size: 20px; 
  background: none; 
  border: 1px solid var(--border); 
  padding: 6px 10px; 
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.nav__list { 
  display: flex; 
  gap: 18px; 
  align-items: center; 
  list-style: none; 
  margin: 0; 
  padding: 0; 
}

.nav__list a { 
  color: var(--text); 
  text-decoration: none; 
  opacity: 0.9;
  transition: all 0.2s ease;
  position: relative;
}

.nav__list a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.2s ease;
}

.nav__list a:hover { 
  color: var(--brand);
  opacity: 1;
}

.nav__list a:hover::after {
  width: 100%;
}

/* ==================== BUTTONS ==================== */
.btn { 
  background: var(--brand); 
  color: white; 
  border: none; 
  padding: 10px 16px; 
  border-radius: 10px; 
  cursor: pointer; 
  text-decoration: none; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn:hover { 
  background: var(--brand-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn--ghost { 
  background: transparent; 
  color: var(--text); 
  border: 1px solid var(--border); 
}

.btn--ghost:hover { 
  border-color: var(--brand); 
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, transparent);
  transform: translateY(-2px);
}

/* ==================== HERO ==================== */
.hero { 
  padding: 100px 0 60px; 
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, var(--bg)), var(--bg)); 
}

.hero__content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero__content h1 { 
  font-size: clamp(28px, 4vw, 44px); 
  line-height: 1.2; 
  margin: 0 0 12px; 
}

.hero__content p { 
  font-size: clamp(16px, 2.2vw, 18px); 
  color: var(--muted); 
  max-width: 680px; 
}

.hero__cta { 
  margin-top: 22px; 
  display: flex; 
  gap: 12px; 
}

.hero__scroll { 
  text-align: center; 
  opacity: 0.4; 
  padding: 26px 0 0;
  animation: bounce 2s infinite;
}

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

.hero__photo {
  width: 100%;
  max-width: 250px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}

.hero__photo img {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  margin-inline: auto;
  transform-origin: center center;
  transition: transform 220ms ease;
}

.hero__photo img:hover {
  transform: scale(1.05) rotate(2deg);
}

/* ==================== SECTIONS ==================== */
.section { 
  padding: 70px 0; 
}

.section--alt { 
  background: var(--surface);
  padding: 70px 0;
}

.section--full {
  padding-left: 0;
  padding-right: 0;
}

.section__header h2 { 
  font-size: clamp(22px, 3.2vw, 32px); 
  margin: 0 0 6px; 
}

.section__header p { 
  color: var(--muted); 
  margin: 0; 
}

/* ==================== GRID ==================== */
.grid { 
  display: grid; 
  gap: 22px; 
}

.projects { 
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
}

/* ==================== CARDS ==================== */
.card { 
  background: var(--bg); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  padding: 18px; 
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(2, 6, 23, 0.12);
}

.card h3 { 
  margin: 10px 0 6px; 
  font-size: 18px; 
}

.card p { 
  margin: 0 0 12px; 
  color: var(--muted); 
}

.card .tags { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
}

.tag { 
  font-size: 12px; 
  padding: 4px 8px; 
  border-radius: 999px; 
  background: var(--surface); 
  border: 1px solid var(--border); 
  color: var(--muted); 
}

.card .actions { 
  margin-top: 12px; 
  display: flex; 
  gap: 10px; 
}

.card.is-clickable { 
  cursor: pointer; 
  position: relative; 
}

.card.is-clickable::after {
  content: "Cliquer pour les détails";
  position: absolute; 
  right: 12px; 
  bottom: 12px;
  font-size: 12px; 
  color: var(--muted);
  opacity: 0; 
  transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.card.is-clickable:hover::after { 
  opacity: 1; 
  transform: translateY(0); 
}

/* Card cover image */
.card__cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ==================== SKILLS ==================== */
.skills { 
  display: grid; 
  gap: 24px; 
  grid-template-columns: repeat(3, 1fr); 
}

.skills__group { 
  background: var(--bg); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  padding: 18px;
  transition: all 0.3s ease;
}

.skills__group:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
  border-color: var(--brand);
}

.skills__group h3 { 
  margin: 0 0 10px; 
  font-size: 16px;
  color: var(--brand);
}

.skills__group ul { 
  margin: 0; 
  padding-left: 18px; 
}

.skills__group li {
  margin-bottom: 6px;
}

/* ==================== TIMELINE ==================== */
.timeline { 
  position: relative; 
  margin-left: 8px; 
}

.timeline::before { 
  content: ""; 
  position: absolute; 
  left: 10px; 
  top: 0; 
  bottom: 0; 
  width: 2px; 
  background: var(--border); 
}

.timeline__item { 
  position: relative; 
  padding-left: 32px; 
  margin-bottom: 22px;
  transition: all 0.3s ease;
}

.timeline__item:hover {
  transform: translateX(4px);
}

.timeline__dot { 
  position: absolute; 
  left: 3px; 
  top: 4px; 
  width: 14px; 
  height: 14px; 
  background: var(--brand); 
  border-radius: 50%; 
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
  transition: all 0.3s ease;
}

.timeline__item:hover .timeline__dot {
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 25%, transparent);
  transform: scale(1.2);
}

.timeline__content h3 { 
  margin: 0 0 4px; 
  font-size: 16px; 
}

/* ==================== INTÉRÊTS (FLIP CARDS) ==================== */
.interests-grid-flip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.interest-card-container {
  perspective: 1000px;
  min-height: 160px;
  height: 180px;
  position: relative;
}

/* Checkbox caché */
.interest-card-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Label prend toute la place */
.interest-card-container label {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.interest-card {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s;
  transform-style: preserve-3d;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.04);
}

/* Desktop: hover pour retourner */
@media (min-width: 721px) {
  .interest-card-container:hover .interest-card {
    transform: rotateY(180deg);
  }
}

/* Mobile ET Desktop: clic sur checkbox pour retourner */
.interest-card-container input[type="checkbox"]:checked ~ label .interest-card {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  pointer-events: none;
}

.card-front:hover {
  border-color: var(--brand);
}

.card-front .card-emoji {
  font-size: 42px;
  margin-bottom: 12px;
  line-height: 1;
}

.card-front h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.card-back {
  transform: rotateY(180deg);
  background: var(--surface);
}

.card-back p { 
  font-size: 15px; 
  color: var(--muted); 
  margin: 0; 
  padding: 0 8px; 
}

/* ==================== CONTACT ==================== */
.contact { 
  display: grid; 
  gap: 24px; 
  grid-template-columns: 1.3fr 1fr; 
}

.form__row { 
  display: grid; 
  gap: 6px; 
  margin-bottom: 12px; 
}

input, textarea { 
  background: var(--bg); 
  color: var(--text); 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  padding: 10px 12px;
  transition: all 0.2s ease;
  font-family: inherit;
}

input:focus, textarea:focus { 
  outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); 
  outline-offset: 2px;
  border-color: var(--brand);
}

.form__actions { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.contact__info { 
  align-self: start; 
}

.contact__links { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.contact__link i {
  font-size: 20px;
  color: var(--brand);
  transition: transform 0.2s ease, color 0.2s ease;
  min-width: 20px;
}

.contact__link:hover i {
  transform: scale(1.2);
  color: var(--brand-600);
}

.contact__link:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.1);
}

/* ==================== MODAL PROJETS ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.modal__close:hover {
  background: var(--brand);
  color: white;
  transform: rotate(90deg);
}

.modal__header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal__header h3 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--text);
}

.modal__header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.modal__body {
  padding: 24px;
}

.modal__media {
  position: relative;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.modal__media img {
  width: 100%;
  height: auto;
  display: block;
}

.modal__media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.modal__media-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.modal__media-nav--prev {
  left: 12px;
}

.modal__media-nav--next {
  right: 12px;
}

.modal__content {
  color: var(--text);
  line-height: 1.7;
}

.modal__section {
  margin-bottom: 24px;
}

.modal__section h4 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--brand);
}

.modal__section p,
.modal__section ul,
.modal__section li {
  margin: 0 0 8px;
  color: var(--muted);
}

.modal__section ul {
  padding-left: 20px;
}

.modal__section li {
  margin-bottom: 8px;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ==================== FOOTER ==================== */
.site-footer { 
  border-top: 1px solid var(--border); 
  padding: 22px 0; 
}

.footer__grid { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
}

/* ==================== SCROLL REVEAL ==================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== PREFERS REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal { 
    opacity: 1 !important; 
    transform: none !important; 
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .skills { 
    grid-template-columns: 1fr; 
  }
  .contact { 
    grid-template-columns: 1fr; 
  }
  .interests-grid-flip {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal__dialog {
    max-width: 95%;
    max-height: 90vh;
  }
}

@media (max-width: 1024px) {
  .skills {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .skills {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 80px 0 40px;
  }
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__text {
    order: 2;
  }
  .hero__photo {
    order: 1;
    margin-bottom: 20px;
  }
  .hero__cta {
    justify-content: center;
    flex-direction: column;
  }
  .nav__toggle { 
    display: inline-block; 
  }
  .nav__list { 
    position: absolute; 
    right: 4%; 
    top: 64px; 
    background: var(--bg); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 12px; 
    display: none; 
    flex-direction: column; 
    width: 220px; 
    box-shadow: var(--shadow); 
  }
  .nav__list.open { 
    display: flex; 
  }
  .interests-grid-flip {
    grid-template-columns: 1fr;
  }
  .interest-card-container:hover .interest-card { 
    transform: none; 
  }
  .modal__dialog {
    margin: 10px;
    max-height: 95vh;
  }
  .modal__header {
    padding: 20px 20px 12px;
  }
  .modal__body {
    padding: 20px;
  }
  .modal__media-nav {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}

body.modal-open { 
  overflow: hidden; 
}