/* Portfolio — thème sombre, accent ambre */

:root {
    --bg: #0c0e12;
    --bg-alt: #12151c;
    --surface: #1a1f2a;
    --border: #2a3142;
    --text: #e8eaef;
    --muted: #9aa3b5;
    --accent: #f0a030;
    --accent-hover: #ffb84d;
    --danger: #e85d5d;
    --success: #4ade80;
    --error: #f87171;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    --font: "DM Sans", system-ui, sans-serif;
    --font-display: "Instrument Serif", Georgia, serif;
    --max: 1100px;
    --header-h: 72px;
    --discord: #5865f2;
    --linkedin: #0a66c2;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 160, 48, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(240, 160, 48, 0.06), transparent);
}

a {
    color: var(--accent);
    text-decoration: none;
}

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

main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 1.5rem;
    background: rgba(12, 14, 18, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--text);
}

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

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-nav a:not(.btn) {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.site-nav a:not(.btn):hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--text);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* Hero */
.hero {
    padding: 4rem 0 5rem;
    text-align: left;
}

.hero-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 4.5rem);
    font-weight: 400;
    line-height: 1.05;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.hero-bio {
    max-width: 36rem;
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0 0 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-alt);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    margin: 0 0 0.35rem;
}

.section-head p {
    color: var(--muted);
    margin: 0 0 2rem;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.project-card {
    position: relative;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    border-color: rgba(240, 160, 48, 0.4);
    box-shadow: var(--shadow);
}

.project-card--featured {
    border-color: rgba(240, 160, 48, 0.35);
    background: linear-gradient(145deg, var(--surface) 0%, #1f2430 100%);
}

.project-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(240, 160, 48, 0.2);
    color: var(--accent);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.badge-sm {
    margin-left: 0.5rem;
    margin-bottom: 0;
    vertical-align: middle;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.tag-list li {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
}

.project-card__thumb-link {
    display: block;
    margin: -0.25rem 0 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.project-card__thumb {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Project modal (CSS :target, sans JavaScript) */
body:has(.project-modal:target) {
    overflow: hidden;
}

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.project-modal:target {
    display: flex;
}

.project-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    cursor: default;
}

.project-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: min(92vh, 900px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    animation: modal-in 0.25s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.project-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.project-modal__header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    margin: 0.35rem 0 0;
    line-height: 1.2;
}

.project-modal__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.project-modal__close:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(240, 160, 48, 0.1);
}

.project-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.project-modal__text p {
    color: var(--muted);
    margin: 0 0 1rem;
}

.project-modal__text p:last-child {
    margin-bottom: 0;
}

.project-modal__footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
}

.tag-list--modal {
    margin: 0.5rem 0 0;
}

.modal-media {
    margin: 0 0 1.25rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}

.modal-media--image img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.modal-media--video {
    position: relative;
    aspect-ratio: 16 / 9;
}

.modal-media--video iframe,
.modal-media--video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Skills */
.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-cloud li {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 500;
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.contact-tile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.contact-tile--discord {
    background: linear-gradient(145deg, rgba(88, 101, 242, 0.12) 0%, var(--surface) 55%);
    border-color: rgba(88, 101, 242, 0.35);
    box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.06) inset;
}

.contact-tile--discord .contact-tile__icon.contact-tile__icon--line {
    color: var(--discord);
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.35);
}

.contact-tile--link:hover {
    border-color: rgba(240, 160, 48, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.contact-tile--linkedin:hover {
    border-color: rgba(10, 102, 194, 0.45);
}

.contact-tile--linkedin .contact-tile__icon {
    color: #8ab4ff;
    background: rgba(10, 102, 194, 0.12);
    border: 1px solid rgba(10, 102, 194, 0.3);
}

.contact-tile__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--accent);
}

.contact-tile__icon svg {
    display: block;
    flex-shrink: 0;
}

.contact-tile__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contact-tile__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.contact-tile__value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.contact-tile__value--mono {
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    user-select: all;
}

.contact-tile__hint {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
    margin-top: 0.25rem;
}

.contact-tile__cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.35rem;
}

.contact-tile--link .contact-tile__value {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.95rem;
}

.contact-tile--link:hover .contact-tile__cta {
    color: var(--accent-hover);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.site-footer p {
    margin: 0;
}

/* Auth */
.page-auth main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 0.25rem;
}

.auth-hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.auth-back {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.auth-back a {
    color: var(--muted);
}

/* Forms */
.form label {
    display: block;
    margin-bottom: 1rem;
}

.form label span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="url"],
.form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-error {
    padding: 0.65rem 0.85rem;
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label span {
    text-transform: none;
    font-weight: 400;
    color: var(--text);
}

/* Admin */
.page-admin main {
    padding-top: 2rem;
}

.admin-header {
    margin-bottom: 2.5rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin: 0 0 0.35rem;
}

.admin-header p {
    color: var(--muted);
    margin: 0 0 1rem;
}

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

.admin-panel h2 {
    font-size: 1.15rem;
    margin: 0 0 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.form-grid .full {
    grid-column: 1 / -1;
}

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

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

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

.admin-project-list p {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.35rem 0 0;
}

.empty-state {
    color: var(--muted);
    font-style: italic;
}

.admin-hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.admin-project-edit {
    flex: 1;
    min-width: 0;
}

.admin-project-edit summary {
    cursor: pointer;
    list-style: none;
    padding: 0.25rem 0;
}

.admin-project-edit summary::-webkit-details-marker {
    display: none;
}

.admin-project-edit summary::before {
    content: "▸ ";
    color: var(--accent);
}

.admin-project-edit[open] summary::before {
    content: "▾ ";
}

.admin-project-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.admin-project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-delete-form {
    flex-shrink: 0;
}

.admin-project-list li {
    align-items: stretch;
}

/* Flash */
.flash {
    position: fixed;
    top: calc(var(--header-h) + 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow);
}

.flash-success {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.flash-error {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.page-auth .flash {
    top: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        height: auto;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
    }

    .site-nav {
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-project-list li {
        flex-direction: column;
    }
}
