:root {
    color-scheme: dark;
    --bg: #0b1218;
    --panel: #111c28;
    --panel-strong: #172639;
    --text: #e5efff;
    --muted: #7aa4d2;
    --accent: #57c7ff;
    --border: rgba(87, 199, 255, 0.15);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Fira Code', 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    background: radial-gradient(circle at top left, rgba(87, 199, 255, 0.15), transparent 30%),
                linear-gradient(180deg, #0b1218 0%, #081019 100%);
    color: var(--text);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 24px, rgba(255,255,255,0.03) 25px, transparent 26px);
    opacity: 0.15;
    pointer-events: none;
}

header {
    text-align: center;
    padding: 40px 20px 35px;
    background: linear-gradient(180deg, rgba(8, 20, 33, 0.96), rgba(11, 18, 24, 0.8));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

header img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 16px;
    object-fit: cover;
    border: 1px solid rgba(87, 199, 255, 0.35);
    box-shadow: 0 0 0 6px rgba(87, 199, 255, 0.06);
}

h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 4rem);
    letter-spacing: -0.04em;
    color: #d7e6ff;
}

header p {
    margin: 10px auto 0;
    max-width: 520px;
    color: var(--muted);
}

section {
    margin: 24px auto;
    padding: 0 20px;
    max-width: 1000px;
}

section h2 {
    margin-bottom: 18px;
    font-size: 1.75rem;
    color: var(--accent);
}

#bio, #work, #code-preview {
    background: rgba(18, 32, 49, 0.9);
    border: 1px solid rgba(87, 199, 255, 0.12);
    padding: 28px;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

#bio p,
#code-preview p {
    color: #cfdffb;
    max-width: 820px;
}

.code-sample {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(87, 199, 255, 0.16);
    background: rgba(7, 13, 22, 0.95);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 22px 40px rgba(0,0,0,0.24);
}

.code-sample::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(87, 199, 255, 0.18) 0%, transparent 35%, rgba(87, 199, 255, 0.08) 72%, transparent 100%);
    opacity: 0.45;
    pointer-events: none;
    animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.code-sample pre {
    position: relative;
    margin: 0;
    padding: 22px;
    font-family: 'Fira Code', 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #c8dbff;
    white-space: pre;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.contact-card {
    background: rgba(11, 20, 34, 0.82);
    border: 1px solid rgba(87, 199, 255, 0.16);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.contact-card h3 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 1.05rem;
}

.contact-card p,
.contact-card a {
    color: #c9dbff;
}

.contact-card a {
    text-decoration: none;
}

.contact-card a:hover {
    color: #82d4ff;
}

.project {
    width: 220px;
    min-height: 220px;
    border: 1px solid rgba(87, 199, 255, 0.18);
    margin: 10px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 22px;
    background: rgba(11, 20, 34, 0.82);
    color: #d6e6ff;
    border-radius: 18px;
    box-shadow: 0 24px 45px rgba(2, 12, 26, 0.25);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.project .gear {
    font-size: 2.1rem;
    display: block;
    color: var(--accent);
    text-shadow: 0 0 16px rgba(87, 199, 255, 0.25);
    animation: spin 5s linear infinite;
}

.gear-large {
    font-size: 3rem;
}

.project-title {
    width: 100%;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.project-description {
    font-size: 0.95rem;
    color: #b3c6e3;
    max-width: 100%;
    margin-bottom: 18px;
}

.project-action {
    border: 1px solid rgba(87, 199, 255, 0.3);
    background: rgba(87, 199, 255, 0.08);
    color: var(--accent);
    font: inherit;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.project-action:hover {
    background: rgba(87, 199, 255, 0.14);
    transform: translateY(-1px);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.project:hover {
    transform: translateY(-6px);
    background: rgba(15, 29, 50, 0.95);
    border-color: rgba(87, 199, 255, 0.35);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 20, 0.88);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-panel {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: rgba(11, 20, 34, 0.98);
    border: 1px solid rgba(87, 199, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    padding: 32px 32px 28px;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: none;
    background: transparent;
    color: #d7e6ff;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.76;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
}

.modal-icon {
    font-size: 2.6rem;
    color: var(--accent);
    margin-bottom: 14px;
    text-shadow: 0 0 18px rgba(87, 199, 255, 0.22);
}

.modal-content h2 {
    margin: 0 0 16px;
    font-size: clamp(1.8rem, 2vw, 2.3rem);
    color: #d7e6ff;
}

.modal-content p,
.modal-content li {
    color: #c9d9f9;
    line-height: 1.8;
}

.modal-content ul {
    margin: 14px 0 0 18px;
}

.modal-gear-large {
    display: inline-flex;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 18px auto 0;
    border-radius: 50%;
    border: 1px solid rgba(87, 199, 255, 0.25);
    background: rgba(87, 199, 255, 0.08);
    font-size: 2rem;
    align-items: center;
    color: var(--accent);
}

#work {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

footer {
    margin: 24px auto 32px;
    padding: 22px 20px;
    max-width: 1000px;
    background: rgba(18, 32, 49, 0.9);
    color: var(--muted);
    border: 1px solid rgba(87, 199, 255, 0.1);
    border-radius: 18px;
    text-align: center;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #82d4ff;
    text-decoration: underline;
}

@media (max-width: 740px) {
    .project {
        width: 100%;
        max-width: 100%;
        line-height: normal;
    }

    #work {
        display: grid;
        grid-template-columns: 1fr;
    }
}
