:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --gray: #6e6e73;
    --gray-lighter: #f5f5f7;
    --gray-light: #e3e3e3;
    --blue: #1d4ed8;
    --max-width: 640px;
    --side-padding: 1.5rem;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--black);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Links page */
.links-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4.5rem var(--side-padding) 3rem;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2.5rem;
}

.profile-portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.25rem;
}

.profile h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.4rem;
}

.profile-tagline {
    font-size: 0.95rem;
    color: var(--gray);
    margin: 0;
    max-width: 34ch;
}

/* Pixel icons (clin d'œil geek) */
.hero-pixels {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.pixel-icon {
    display: block;
    width: 20px;
    height: 20px;
    shape-rendering: crispEdges;
    transition: transform 0.2s ease;
}

.pixel-icon rect {
    fill: currentColor;
}

.pixel-icon-wrap {
    position: relative;
    display: inline-flex;
    cursor: default;
}

.pixel-icon-wrap:hover .pixel-icon {
    transform: scale(1.3) rotate(-4deg);
}

.pixel-icon-wrap::after,
.pixel-icon-wrap::before {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.pixel-icon-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 11px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--black);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    z-index: 5;
}

.pixel-icon-wrap::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: var(--black);
    z-index: 5;
}

.pixel-icon-wrap:hover::after,
.pixel-icon-wrap:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Garde la bulle à l'écran pour les icônes les plus proches des bords */
.hero-pixels .pixel-icon-wrap:first-child::after {
    left: 0;
    transform: translateX(0) translateY(4px);
}

.hero-pixels .pixel-icon-wrap:first-child:hover::after {
    transform: translateX(0) translateY(0);
}

.hero-pixels .pixel-icon-wrap:last-child::after {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
}

.hero-pixels .pixel-icon-wrap:last-child:hover::after {
    transform: translateX(0) translateY(0);
}

/* Bento grid */
.link-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: row dense;
    gap: 0.85rem;
}

.link-card {
    display: flex;
    padding: 1.1rem;
    border: 1px solid var(--gray-light);
    border-radius: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.link-card:hover {
    border-color: var(--black);
    transform: translateY(-2px);
}

.link-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gray-lighter);
    color: var(--black);
}

.link-card-icon svg {
    width: 19px;
    height: 19px;
}

.link-card-body {
    min-width: 0;
    flex: 1;
}

.link-card-title {
    display: block;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.link-card-description {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--gray-light);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.link-card-arrow svg {
    width: 16px;
    height: 16px;
}

.link-card:hover .link-card-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--black);
}

/* medium (défaut) : icône + texte en ligne, 2 colonnes */
.link-card--medium {
    grid-column: span 2;
    align-items: center;
    gap: 0.9rem;
}

/* wide : bandeau CTA pleine largeur, mis en avant */
.link-card--wide {
    grid-column: span 4;
    align-items: center;
    gap: 0.9rem;
    background: var(--gray-lighter);
    border-color: transparent;
}

.link-card--wide:hover {
    border-color: var(--black);
}

/* large : tuile carrée, icône au-dessus du texte. Pas d'aspect-ratio : la
   hauteur de ligne de la grille (align-items: stretch, par défaut) égalise
   déjà les tuiles voisines sur la hauteur du contenu le plus grand ; un
   ratio fixe ferait déborder le texte quand il est plus long. */
.link-card--large {
    grid-column: span 2;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    min-height: 190px;
}

.link-card--large .link-card-icon {
    width: 44px;
    height: 44px;
}

.link-card--large .link-card-icon svg {
    width: 21px;
    height: 21px;
}

.link-card--large .link-card-title {
    font-size: 1.05rem;
}

.link-card--large .link-card-description {
    white-space: normal;
}

/* small : tuile carrée, icône + libellé seuls (réseaux sociaux) */
.link-card--small {
    grid-column: span 1;
    aspect-ratio: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
}

.link-card--small .link-card-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray);
}

.link-grid > .reveal:nth-child(1) { transition-delay: 0ms; }
.link-grid > .reveal:nth-child(2) { transition-delay: 60ms; }
.link-grid > .reveal:nth-child(3) { transition-delay: 120ms; }
.link-grid > .reveal:nth-child(4) { transition-delay: 180ms; }
.link-grid > .reveal:nth-child(5) { transition-delay: 240ms; }
.link-grid > .reveal:nth-child(6) { transition-delay: 300ms; }
.link-grid > .reveal:nth-child(7) { transition-delay: 360ms; }
.link-grid > .reveal:nth-child(8) { transition-delay: 420ms; }

.button {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    background: var(--gray-light);
    color: var(--black);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.button:hover {
    opacity: 0.9;
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--side-padding) 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray);
}

.site-footer p {
    margin: 0;
}

/* Animations d'apparition (au chargement et au défilement) */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* 404 */
.error-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 5rem;
    padding-bottom: 6rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--side-padding);
    padding-right: var(--side-padding);
}

.error-404-digits {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.error-404-digit {
    width: 52px;
    height: auto;
    shape-rendering: crispEdges;
    color: var(--black);
}

.error-404-digit rect {
    fill: currentColor;
}

.error-404-ghost {
    width: 64px;
    height: auto;
    margin-bottom: 2rem;
    shape-rendering: crispEdges;
    color: var(--gray-light);
    animation: float-ghost 3s ease-in-out infinite;
}

.error-404-ghost rect {
    fill: currentColor;
}

@keyframes float-ghost {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
    .error-404-ghost {
        animation: none;
    }
}

.error-404 h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.error-404 p {
    color: var(--gray);
    max-width: 40ch;
    margin: 0 0 2rem;
}

/* Responsive */
@media (max-width: 560px) {
    .links-page {
        padding-top: 3.5rem;
    }

    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .link-card--wide {
        grid-column: span 2;
    }
}

@media (max-width: 420px) {
    .link-card-description {
        display: none;
    }

    .link-card--large .link-card-description {
        display: block;
    }
}
