/* ==========================================================================
   TIMOTHÉUS — CONTENU DES PAGES (Projets, À propos, Contact, fiche projet)
   ========================================================================== */

.sub-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   PROJETS — tableau
   -------------------------------------------------------------------------- */
.table {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.table__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.table__row {
  display: grid;
  grid-template-columns: 37% 1fr auto;
  column-gap: 10px;
  width: 100%;
  text-align: left;
  line-height: 1.34;
}

.table__row > :last-child {
  text-align: right;
}

.table__head {
  margin-bottom: 6px;
}

.table button.table__row {
  --hit-x: 6px;
  --hit-y: 0px;
}

/* --------------------------------------------------------------------------
   PROJETS — services & chiffres
   -------------------------------------------------------------------------- */
.services-block {
  margin-top: 34px;
}

/* 7 services : 4 sur la 1re ligne, 3 sur la 2e (grille de 12 colonnes) */
.services {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  row-gap: 12px;
  column-gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.services li {
  grid-column: span 3;
  text-align: center;
}

.services li:nth-child(n + 5) {
  grid-column: span 4;
}

.services li:nth-child(1),
.services li:nth-child(5) {
  text-align: left;
}

.services li:nth-child(4),
.services li:nth-child(7) {
  text-align: right;
}

.service {
  display: inline-block;
  text-align: inherit;
  line-height: 1.35;
}

.service-panel {
  margin-top: 18px;
}

.service-panel__hint {
  margin: 0;
  color: var(--muted);
  font-size: calc(var(--fs-mono) - 1px);
}

.service-panel__content {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.service-panel__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: calc(var(--fs-nav) + 3px);
  letter-spacing: -0.01em;
}

.service-panel__text {
  margin: 8px 0 0;
  line-height: 1.5;
}

.service-panel__points {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  line-height: 1.6;
}

.service-panel__points li::before {
  content: "— ";
}

.stats-block {
  margin-top: 22px;
}

.stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.stat {
  text-align: center;
}

.stat__num {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-stat);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-stat-label);
  line-height: 1.3;
  text-align: center;
}

/* --------------------------------------------------------------------------
   À PROPOS
   -------------------------------------------------------------------------- */
.portrait {
  margin: 22px calc((var(--card-pad) - 10px) * -1) 0;
  aspect-ratio: 16 / 9.1;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-top: 36px;
}

.bio p {
  margin: 0;
}

.bio__text {
  white-space: nowrap;
}

.bio__text span {
  display: block;
}

.intro {
  margin: 28px 0 0;
  line-height: 1.55;
}

/* Parcours : deux blocs distincts, pro | scolaire */
.cv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
}

.cv__col {
  min-width: 0;
}

.cv__label {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.cv__item {
  margin-top: 14px;
}

.cv__item p,
.cv__item h3 {
  margin: 0;
}

.cv__years,
.cv__place {
  color: var(--muted);
  font-size: calc(var(--fs-mono) - 1px);
}

.cv__title {
  margin-top: 2px !important;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-nav);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.cv__text {
  margin-top: 4px !important;
  font-size: calc(var(--fs-mono) - 1px);
  line-height: 1.45;
}

.details__row {
  display: grid;
  grid-template-columns: 26% 1fr;
  column-gap: 12px;
  line-height: 1.5;
}

.details {
  margin: 22px 0 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

.about-cta {
  margin-top: 36px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   CONTACT
   -------------------------------------------------------------------------- */
.form {
  margin-top: 36px;
}

.fgroup {
  margin-bottom: 14px;
}

.field {
  position: relative;
  display: block;
}

/* même rectangle blanc que .hit, sur le champ actif */
.field::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) ease;
}

.field:focus-within::after {
  opacity: 1;
}

@media (hover: hover) {
  .field:hover::after {
    opacity: 0.35;
  }
  .field:focus-within:hover::after {
    opacity: 1;
  }
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 8px 12px 8px 28px;
  background: transparent;
  border: 0;
  outline: none;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.02em;
}

.field textarea {
  height: 220px;
  resize: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field.has-error::after {
  opacity: 0.6;
  border-color: #ffb3a6;
}

.field__error {
  display: block;
  min-height: 0;
  padding: 0 0 0 28px;
  color: #ffc2b8;
  font-size: calc(var(--fs-mono) - 2px);
  line-height: 1.3;
}

.field__error:empty {
  display: none;
}

.field__error:not(:empty) {
  padding-top: 4px;
}

.hp {
  position: absolute !important;
  left: -9999px;
  opacity: 0;
}

.form__status {
  margin: 10px 0 0;
  color: #ffc2b8;
  font-size: calc(var(--fs-mono) - 2px);
  text-align: center;
}

.form__status:empty {
  display: none;
}

.form .btn--block {
  margin-top: 8px;
}

.success {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 340px;
  margin-top: 36px;
  text-align: center;
}

.success__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: calc(var(--fs-logo) * 0.75);
  letter-spacing: -0.02em;
}

.success__note {
  margin: 0;
  color: var(--muted);
}

.footer {
  margin: 28px 0 0;
  text-align: center;
}

/* --------------------------------------------------------------------------
   FICHE PROJET (modale)
   -------------------------------------------------------------------------- */
.modal {
  width: min(640px, 92vw);
  max-width: none;
  max-height: 92svh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__card {
  max-height: 92svh;
  overflow: auto;
  padding: calc(var(--card-pad) * 0.7);
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  background: var(--tint-modal);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(160%);
  backdrop-filter: blur(var(--card-blur)) saturate(160%);
}

.modal__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tint-work), #3a1208;
  display: grid;
  place-items: center;
}

.modal__media img,
.modal__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.modal__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--fs-logo);
  letter-spacing: -0.04em;
  line-height: 1;
}

.modal__close {
  font-size: var(--fs-mono);
}

.modal__meta {
  display: flex;
  gap: 40px;
  margin: 18px 0 0;
}

.modal__meta div {
  display: flex;
  gap: 10px;
}

.modal__meta dt {
  color: var(--muted);
}

.modal__meta dd {
  margin: 0;
}

.modal__text {
  margin: 18px 0 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   MOBILE
   -------------------------------------------------------------------------- */
.stage {
  transition: padding-top var(--t-page) var(--ease);
}

@media (max-width: 640px) {
  .stage {
    padding: 24px 0;
    align-items: center;
  }

  .nav {
    margin-top: 20px;
  }

  body[data-page="home"] .nav {
    margin-top: 12px;
  }

  .section-label {
    margin-top: 18px;
  }

  .table {
    margin-top: 16px;
  }

  .table__row {
    grid-template-columns: 44% 1fr auto;
    line-height: 1.75;
  }

  .services-block {
    margin-top: 22px;
  }

  .stat__label {
    margin-top: 5px;
  }

  .portrait {
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 14px;
  }

  .bio {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 22px;
  }

  .bio__text {
    white-space: normal;
  }

  .about-cta {
    margin-top: 22px;
  }

  .intro {
    margin-top: 20px;
  }

  .cv {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 22px;
  }

  .details__row {
    grid-template-columns: 30% 1fr;
  }

  .form {
    margin-top: 22px;
  }

  .field input,
  .field textarea {
    padding-left: 18px;
    font-size: 16px; /* évite le zoom automatique sur iOS */
  }

  .field input::placeholder,
  .field textarea::placeholder {
    font-size: var(--fs-mono);
  }

  .field textarea {
    height: 200px;
  }

  .field__error {
    padding-left: 18px;
  }

  .footer {
    margin-top: 18px;
  }
}

/* Très petits écrans : services et chiffres en grille 2×2 */
@media (max-width: 360px) {
  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 14px;
  }

  .stat:nth-child(even) {
    text-align: right;
  }

  .stat:nth-child(odd) {
    text-align: left;
  }

  .stat .stat__label {
    text-align: inherit;
  }
}

/* --------------------------------------------------------------------------
   FICHE PROJET — couverture numérotée + galerie
   -------------------------------------------------------------------------- */
.modal--gallery {
  width: min(880px, 94vw);
}

.modal__cover,
.gallery__item {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: zoom-in;
}

.modal__cover img,
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}

@media (hover: hover) {
  .modal__cover:hover img,
  .gallery__item:hover img {
    transform: scale(1.03);
  }
}

/* le rectangle blanc de survol se place à l'intérieur de l'image */
.modal__cover.hit::after,
.gallery__item.hit::after {
  inset: 8px;
  z-index: 1;
}

.gallery__num {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.gallery:empty {
  display: none;
}

.gallery__item {
  height: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.gallery__item--wide {
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   VISIONNEUSE PLEIN ÉCRAN
   -------------------------------------------------------------------------- */
.lightbox {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: hidden;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px 24px 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100svh - 90px);
  object-fit: contain;
  cursor: e-resize;
  transition:
    opacity 250ms ease,
    transform 350ms var(--ease);
}

.lightbox__img.is-changing {
  opacity: 0;
  transform: translateX(calc(var(--dir, 0) * 24px));
}

.lightbox__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  font-size: 12px;
}

.lightbox__nav {
  display: flex;
  gap: 24px;
}

@media (max-width: 640px) {
  .gallery {
    gap: 8px;
  }

  .gallery__item {
    border-radius: 8px;
  }

  .lightbox__stage {
    padding: 16px 8px 0;
  }

  .lightbox__bar {
    padding: 14px 16px;
    font-size: 10px;
  }

  .lightbox__nav {
    gap: 16px;
  }
}

/* pas de contour navigateur sur la fiche elle-même (focus d'ouverture) */
.modal:focus,
.modal__card:focus,
.lightbox:focus {
  outline: none;
}

.modal__card {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

/* --------------------------------------------------------------------------
   Croix de fermeture (en haut à droite, toujours visible)
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
}

.close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 10, 10, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  --hit-x: 4px;
  --hit-y: 4px;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}

.close-x span,
.close-x span::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 1.5px;
  margin: -0.75px 0 0 -9px;
  background: var(--white);
  transform: rotate(45deg);
}

.close-x span::before {
  content: "";
  margin: 0;
  top: 0;
  left: 0;
  transform: rotate(90deg);
}

@media (hover: hover) {
  .close-x:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--white);
  }
}

/* dans la visionneuse : coin de l'écran */
.lightbox .close-x {
  top: 18px;
  right: 18px;
}

@media (max-width: 640px) {
  .close-x {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }
}

/* image étroite seule en fin de série : centrée, même taille que les autres */
.gallery__item--center {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 5px);
}

/* À propos : outils / langues / inspirations, une ligne par catégorie */
.details__row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.details__row:last-child {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   CONTACT — nom + prénom côte à côte, mention RGPD, lien mentions légales
   -------------------------------------------------------------------------- */
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.form .field textarea {
  height: 150px;
}

.form__privacy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: calc(var(--fs-mono) - 2px);
  line-height: 1.5;
  text-align: center;
}

.link-legal {
  display: inline;
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
  --hit-x: 4px;
  --hit-y: 2px;
}

/* --------------------------------------------------------------------------
   MENTIONS LÉGALES (dans la fenêtre des fiches)
   -------------------------------------------------------------------------- */
.modal--legal .modal__media {
  display: none;
}

.modal--legal .modal__head {
  margin-top: 0;
  padding-right: 44px;
}

.legal {
  margin-top: 8px;
}

.legal__sec {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.legal__sec h3 {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: calc(var(--fs-nav) + 1px);
  letter-spacing: 0.01em;
}

.legal__sec p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: calc(var(--fs-mono) - 1px);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .form__row {
    gap: 0 8px;
  }

  .form .field textarea {
    height: 130px;
  }
}

.modal--legal .gallery {
  display: block;
}

/* Mobile : textes secondaires plus lisibles */
@media (max-width: 640px) {
  .gallery__num { font-size: 11px; }
  .lightbox__bar { font-size: 11px; }
  .form__privacy,
  .field__error { font-size: 10px; }
  .cv__years,
  .cv__place,
  .cv__text { font-size: 10px; }
}
