/* ==========================================================================
   Page de liens — Guillaume Laloo
   ========================================================================== */

:root {
  --bg: #fcfaf8;
  --surface: #fbf6f0;
  --accent: #a34646;
  --accent-dark: #8a3a3a;
  --text: #2f3e46;
  --text-muted: #56636a;
  --on-accent: #fff;
  --border: #eadfd3;

  --radius: 14px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(47 62 70 / 0.06), 0 2px 6px rgb(47 62 70 / 0.05);
  --shadow-md: 0 4px 10px rgb(47 62 70 / 0.08), 0 10px 24px rgb(47 62 70 / 0.07);
  --shadow-accent: 0 6px 18px rgb(163 70 70 / 0.28);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 480px;
}

/* --- Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --- Mise en page -------------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: max(2.5rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
}

/* --- Profil -------------------------------------------------------------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), var(--shadow-md);
  overflow: hidden;
}

.avatar__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar__img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--fallback .avatar__img {
  display: none;
}

.profile__name {
  margin: 0;
  color: var(--accent);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.profile__role {
  margin: 0 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.profile__tagline {
  max-width: 34ch;
  margin: 0.625rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Icônes des réseaux sociaux */
.social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.125rem 0 0;
  padding: 0;
  list-style: none;
}

.social__link {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.25s var(--ease),
    background-color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.social__link .icon {
  width: 20px;
  height: 20px;
  fill: var(--accent);
  transition: fill 0.25s var(--ease);
}

.social__link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: var(--shadow-md);
}

.social__link:hover .icon {
  fill: var(--on-accent);
}

.social__link:active {
  transform: scale(0.94);
}

.social__link:focus-visible {
  border-radius: 50%;
}

/* --- Boutons ------------------------------------------------------------- */

.btn {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  min-height: 56px;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background-color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn .icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: var(--accent);
  transition: fill 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn__label {
  flex: 1;
  min-width: 0;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.btn:hover .icon {
  transform: scale(1.08);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* Lien secondaire : survol en couleur d'accent */
.btn--link:hover,
.btn--small:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--link:hover .icon,
.btn--small:hover .icon {
  fill: var(--on-accent);
}

/* Bouton principal */
.btn--primary {
  position: relative;
  min-height: 72px;
  padding: 1rem 1.25rem;
  border-color: var(--accent);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
  overflow: hidden;
}

.btn--primary .icon {
  fill: var(--on-accent);
}

.btn--primary strong {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.btn--primary small {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.9;
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 10px 26px rgb(163 70 70 / 0.34);
}

.btn--primary:hover .icon--arrow {
  transform: translateX(4px);
}

/* Reflet lumineux qui traverse le bouton principal */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / 0.22) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: shine 5s var(--ease) 1.4s infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  25%, 100% { transform: translateX(100%); }
}

/* --- Services ------------------------------------------------------------ */

.services__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.service .icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.125rem;
  fill: var(--accent);
}

.service__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.service__text {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* --- Liens --------------------------------------------------------------- */

.links__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Contact ------------------------------------------------------------- */

.section-title {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn--small {
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.75rem;
  font-size: 0.9375rem;
}

.btn--small .btn__label {
  flex: 0 1 auto;
}

/* --- Enregistrer le contact --------------------------------------------- */

.btn--save {
  justify-content: center;
  border: 1.5px dashed var(--accent);
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.btn--save .btn__label {
  flex: 0 1 auto;
}

.btn--save:hover {
  border-style: solid;
  background: var(--accent);
  color: var(--on-accent);
}

.btn--save:hover .icon {
  fill: var(--on-accent);
}

/* --- Pied de page -------------------------------------------------------- */

.footer {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

/* --- Toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: calc(100% - 2.5rem);
  padding: 0.75rem 1.125rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, 1rem);
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* --- Apparition progressive --------------------------------------------- */

/* Masqué seulement si le JS est actif (classe ajoutée par main.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --- Écrans très étroits ------------------------------------------------- */

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

/* --- Réduction des animations ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .btn:hover .icon,
  .btn--primary:hover .icon--arrow {
    transform: none;
  }
}
