/* ==========================================================
   Portfolio – Dark & Tech theme
   Shared by the public site (index.php) and, partially, admin.
   ========================================================== */

:root {
    --bg: #0a0e14;
    --bg-alt: #0d131b;
    --surface: #121924;
    --surface-hover: #161f2c;
    --border: #223047;
    --text: #e6edf3;
    --text-muted: #8b98a8;
    --accent: #22d3ee;
    --accent-2: #8b5cf6;
    --accent-soft: rgba(34, 211, 238, 0.12);
    --green: #34d399;
    --amber: #fbbf24;
    --danger: #f87171;
    --radius: 12px;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(139, 92, 246, 0.08), transparent 40%),
        radial-gradient(circle at 85% 10%, rgba(34, 211, 238, 0.08), transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem clamp(1rem, 4vw, 3rem);
    max-width: 1100px;
    margin: 0 auto;
}

.brand {
    font-family: var(--mono);
    font-size: 1.05rem;
    color: var(--text);
}
.brand .accent { color: var(--accent); }
.brand .cursor {
    color: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lang-toggle {
    font-family: var(--mono);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    transition: border-color 0.15s, color 0.15s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem clamp(1rem, 4vw, 3rem) 1.5rem;
}
.hero .prompt {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}
.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 0.4rem;
    letter-spacing: -0.01em;
}
.hero .tagline {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0 0 0.75rem;
}
.hero .intro {
    color: var(--text-muted);
    max-width: 62ch;
    margin: 0;
}

/* ---------- Project grid ---------- */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 4vw, 3rem) 4rem;
}

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: var(--surface-hover);
}

.card-thumb {
    height: 150px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.card-thumb .thumb-letter {
    font-family: var(--mono);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.status-pill {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.15);
}
.status-pill.live { color: var(--green); border-color: var(--green); }
.status-pill.showcase { color: var(--amber); border-color: var(--amber); }

.card-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.card-body h3 {
    margin: 0;
    font-size: 1.08rem;
}
.card-body .card-tagline {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
    flex: 1;
}
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}
.tech-badges span {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}
.card-link {
    font-family: var(--mono);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 12, 0.78);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem;
    overflow-y: auto;
    z-index: 100;
}
.modal-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 720px;
    width: 100%;
    padding: 2rem;
    position: relative;
    margin: auto;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-inner h2 { margin: 0 0 0.25rem; }
.modal-inner .modal-tagline { color: var(--accent); margin: 0 0 1rem; font-family: var(--mono); font-size: 0.95rem; }
.modal-inner .modal-desc { color: var(--text); margin: 0 0 1.2rem; white-space: pre-line; }
.modal-inner .modal-link {
    display: inline-block;
    font-family: var(--mono);
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
}
.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}
.modal-gallery a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.modal-gallery img { width: 100%; height: 110px; object-fit: cover; display: block; }

/* ---------- Footer ---------- */
footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
    .site-header { flex-direction: row; }
    .hero { padding-top: 1.5rem; }
}
