:root {
    --bg: #0f1419;
    --bg-elevated: #171d26;
    --panel: #1c2430;
    --text: #f4f7fb;
    --muted: #9aa8bc;
    --line: rgba(154, 168, 188, 0.16);
    --accent: #5eead4;
    --accent-soft: rgba(94, 234, 212, 0.14);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
    --radius: 20px;
    --max-width: 1080px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(94, 234, 212, 0.08), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(56, 189, 248, 0.06), transparent 50%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.65;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(15, 20, 25, 0.88);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand:hover {
    text-decoration: none;
    opacity: 0.92;
}

.brand img {
    height: 40px;
    width: auto;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--text);
    text-decoration: none;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px 72px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 28px 24px 40px;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: space-between;
    align-items: center;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer a {
    color: var(--muted);
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 56px;
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
    }
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
}

.lead {
    font-size: 1.12rem;
    color: var(--muted);
    margin: 0 0 24px;
}

.hero-art {
    display: flex;
    justify-content: center;
    padding: 24px;
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.hero-art img {
    max-height: 280px;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--panel);
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    text-decoration: none;
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: #0b1218;
    border-color: transparent;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-icon {
    width: 56px;
    height: 56px;
}

.card h2 {
    margin: 0;
    font-size: 1.25rem;
}

.card p {
    margin: 0;
    color: var(--muted);
    flex: 1;
}

.page-title {
    text-align: center;
    margin: 0 0 32px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.02em;
}

.prose {
    max-width: 760px;
    margin: 0 auto;
}

.prose p,
.prose ul {
    color: var(--muted);
}

.prose h2,
.prose h3 {
    color: var(--text);
    margin-top: 2rem;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

.cta-band {
    margin-top: 48px;
    padding: 36px 28px;
    text-align: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-soft), rgba(56, 189, 248, 0.08));
    border: 1px solid var(--line);
}

.cta-band h2 {
    margin: 0 0 12px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.gallery figure {
    margin: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
}

.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}

.gallery-thumb:hover img {
    transform: scale(1.03);
    transition: transform 0.2s ease;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-image {
    max-width: min(100%, 1200px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

body.lightbox-open {
    overflow: hidden;
}

.admin-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow);
    opacity: 0.85;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.admin-fab:hover {
    opacity: 1;
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-2px);
}

.admin-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-login-shell .admin-card {
    width: 100%;
    max-width: 400px;
}

.admin-card h1,
.admin-card h2 {
    margin-top: 0;
}

.admin-card label {
    display: block;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-card input[type="text"],
.admin-card input[type="password"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
}

.admin-file-label input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.admin-file-label {
    display: block;
    position: relative;
    margin-bottom: 12px;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fff;
}

.admin-hint {
    color: var(--muted);
    font-size: 0.95rem;
}

.admin-error {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.25);
    padding: 10px 12px;
    border-radius: 8px;
}

.admin-status {
    text-align: center;
    color: var(--accent);
    margin-bottom: 16px;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.admin-gallery-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.admin-gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.admin-gallery-actions {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.admin-gallery-actions form {
    margin: 0;
}

.admin-back {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--muted);
}

.project-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    display: grid;
    gap: 14px;
}

.project-list a {
    display: block;
    padding: 18px 22px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.project-list a:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.contact-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.contact-card p {
    margin: 0.5rem 0;
    color: var(--muted);
}

.contact-card strong {
    color: var(--text);
    font-size: 1.2rem;
}

.sub-apps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.sub-apps a {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    color: var(--muted);
}

.sub-apps a:hover {
    color: var(--text);
    text-decoration: none;
}

pre {
    background: #0a0e12;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
}

code {
    font-family: Consolas, "Cascadia Mono", monospace;
}

.blog-note {
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid var(--line);
    color: var(--muted);
    margin-bottom: 24px;
}
