:root {
    --bg: #0f1219;
    --surface: #181c26;
    --border: #2a3142;
    --text: #e8ecf4;
    --muted: #98a3b8;
    --accent: #7c9cff;
    --accent-soft: rgba(124, 156, 255, 0.15);
    --radius: 14px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a {
    color: var(--accent);
}

a:hover {
    text-decoration: underline;
}

/* ——— Page publique : ton premium (ni sobre fade, ni clinquant) ——— */
body.public {
    font-family: "Plus Jakarta Sans", var(--font);
    color: #e8e4f2;
    background-color: #050408;
    background-image:
        radial-gradient(ellipse 140% 90% at 50% -25%, rgba(99, 102, 241, 0.22), transparent 52%),
        radial-gradient(ellipse 55% 45% at 100% 0%, rgba(56, 189, 248, 0.09), transparent),
        radial-gradient(ellipse 45% 50% at -5% 100%, rgba(167, 139, 250, 0.11), transparent),
        radial-gradient(ellipse 80% 60% at 80% 100%, rgba(244, 114, 182, 0.05), transparent);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

body.public a {
    color: #c4b8ff;
    text-decoration-color: rgba(196, 184, 255, 0.35);
}

body.public a:hover {
    color: #e8e0ff;
    text-decoration-color: rgba(232, 224, 255, 0.55);
}

.public .hero {
    position: relative;
    padding: clamp(3.25rem, 8vw, 5.25rem) 0 clamp(2.25rem, 4vw, 3.25rem);
    border-bottom: none;
    background: transparent;
    overflow: hidden;
}

.public .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, transparent 55%);
    pointer-events: none;
}

.public .hero::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(60%, 36rem);
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.22),
        rgba(196, 184, 255, 0.35),
        rgba(255, 255, 255, 0.22),
        transparent
    );
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: none;
    margin: 0;
    width: 100%;
    padding: 0;
    text-align: center;
}

.public .eyebrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(200, 194, 220, 0.75);
    margin: 0 0 1.15rem;
}

.public .eyebrow::before {
    content: "";
    width: 2.75rem;
    height: 1px;
    margin-bottom: 0.85rem;
    background: linear-gradient(90deg, transparent, rgba(196, 184, 255, 0.65), transparent);
}

.public .hero h1 {
    font-family: "Fraunces", "Georgia", serif;
    font-weight: 500;
    font-optical-sizing: auto;
    font-size: clamp(2.35rem, 5.5vw, 3.35rem);
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin: 0 0 1rem;
    background: linear-gradient(165deg, #faf8ff 8%, #d8d0eb 42%, #a99dd4 88%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 0 42px rgba(167, 139, 250, 0.12);
}

.public .lede {
    margin: 0 auto 0;
    color: rgba(182, 176, 204, 0.92);
    font-size: 1.07rem;
    font-weight: 400;
    line-height: 1.65;
    max-width: 48ch;
    letter-spacing: 0.01em;
}

body.public .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(2rem, 4vw, 3rem) 0 clamp(3rem, 6vw, 5rem);
}

.project-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1279px) {
    .project-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

body.public .project-card {
    border-radius: 1.05rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(0, 0, 0, 0.12) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 4px 6px rgba(0, 0, 0, 0.08),
        0 18px 48px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.public .project-card--linked {
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s ease,
        border-color 0.35s ease;
}

body.public .project-card--linked:hover {
    transform: translateY(-5px);
    border-color: rgba(196, 184, 255, 0.32);
    box-shadow:
        0 0 0 1px rgba(196, 184, 255, 0.15) inset,
        0 8px 12px rgba(0, 0, 0, 0.12),
        0 28px 56px rgba(0, 0, 0, 0.45),
        0 0 72px rgba(120, 110, 220, 0.06);
}

a.project-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100%;
    text-decoration: none;
    color: inherit;
    outline: none;
}

a.project-card-link:hover {
    text-decoration: none;
}

body.public a.project-card-link:focus-visible {
    outline: 2px solid rgba(196, 184, 255, 0.65);
    outline-offset: 3px;
}

body.public .project-open-hint {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(196, 184, 255, 0.9);
}

body.public .project-image {
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, #121018 0%, #0a090e 100%);
    overflow: hidden;
    position: relative;
}

body.public .project-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(5, 4, 8, 0.55) 100%);
    pointer-events: none;
}

body.public .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

body.public .project-card--linked:hover .project-image img {
    transform: scale(1.06);
}

body.public .project-image--placeholder {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        repeating-linear-gradient(
            -40deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 14px
        );
    opacity: 1;
}

body.public .project-body {
    padding: 1rem 1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.public .project-body h2 {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f2effa;
}

body.public .project-body p {
    margin: 0;
    color: rgba(165, 158, 190, 0.92);
    font-size: 0.86rem;
    line-height: 1.5;
}

body.public .empty-state {
    text-align: center;
    color: rgba(182, 176, 204, 0.88);
    padding: clamp(2.5rem, 5vw, 3.5rem) 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 1.1rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.public .footer {
    text-align: center;
    padding: 2.75rem 0;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(140, 132, 168, 0.65);
    border-top: none;
    position: relative;
}

body.public .footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 28rem);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

@media (prefers-reduced-motion: reduce) {
    body.public .project-card--linked,
    body.public .project-image img {
        transition: none;
    }

    body.public .project-card--linked:hover {
        transform: none;
    }

    body.public .project-card--linked:hover .project-image img {
        transform: none;
    }
}

/* Admin */
body.admin {
    background: var(--bg);
}

.admin-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #12151d;
    color: var(--text);
    font: inherit;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input[type="file"] {
    font-size: 0.85rem;
    color: var(--muted);
}

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: none;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    background: var(--accent-soft);
    color: var(--accent);
}

.btn:hover {
    filter: brightness(1.1);
}

.btn-primary {
    background: var(--accent);
    color: #0f1219;
}

.btn-danger {
    background: rgba(255, 107, 107, 0.12);
    color: #ff8f8f;
}

.btn-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(255, 107, 107, 0.12);
    color: #ffbcbc;
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.alert-success {
    background: rgba(110, 220, 165, 0.1);
    color: #9de4c5;
    border: 1px solid rgba(110, 220, 165, 0.2);
}

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.project-list li:last-child {
    border-bottom: none;
}

.project-list-thumb {
    width: 72px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #0c0f15;
    flex-shrink: 0;
}

.project-list-meta {
    flex: 1;
    min-width: 0;
}

.project-list-meta strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.badge-hidden {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 180, 100, 0.15);
    color: #f0c995;
    border: 1px solid rgba(255, 180, 100, 0.25);
}

.project-list-row-hidden {
    opacity: 0.72;
}

.project-list-row-hidden .project-list-thumb {
    filter: grayscale(0.35);
}

.project-list-meta span {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-list-link {
    margin-top: 0.25rem;
    color: var(--accent);
    opacity: 0.9;
}

.project-list-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.project-list-actions form {
    margin: 0;
}

.hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.current-image {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}
