/* ===== Theme ===== */

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-light: #21262d;

    --border: #30363d;

    --primary: #58a6ff;
    --primary-dark: #2388ed;
    --secondary: #fd8700;

    --text: #f0f6fc;
    --muted: #8b949e;

    --navbar-bg: rgba(13, 17, 23, 0.82);

    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-small: 0 6px 20px rgba(0, 0, 0, 0.25);

    --radius: 16px;
    --radius-small: 10px;

    --page-width: 1180px;
    --nav-height: 72px;

    --transition: 180ms ease;
}

body.light-theme {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --surface-light: #eef1f4;

    --border: #d0d7de;

    --primary: #0969da;
    --primary-dark: #0550ae;
    --secondary: #d96800;

    --text: #1f2328;
    --muted: #656d76;

    --navbar-bg: rgba(246, 248, 250, 0.86);

    --shadow: 0 10px 40px rgba(31, 35, 40, 0.12);
    --shadow-small: 0 6px 20px rgba(31, 35, 40, 0.1);
}

/* ===== Reset ===== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
    min-height: 100vh;

    background:
        radial-gradient(circle at 15% 10%,
            rgba(88, 166, 255, 0.08),
            transparent 30%),
        radial-gradient(circle at 90% 20%,
            rgba(253, 135, 0, 0.06),
            transparent 28%),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;

    transition:
        background-color var(--transition),
        color var(--transition);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== Shared Layout ===== */

.container {
    width: min(calc(100% - 40px), var(--page-width));
    margin-inline: auto;
}

.section {
    padding: 100px 0;
}

.section-header {
    max-width: 680px;
    margin-bottom: 42px;
}

.section-label {
    display: inline-block;
    margin-bottom: 10px;

    color: var(--secondary);

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-title {
    margin-bottom: 14px;

    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
}

.section-description {
    color: var(--muted);
    font-size: 1.05rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-small);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 46px;
    padding: 0 20px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    font-weight: 700;

    transition:
        transform var(--transition),
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--primary);
    color: #08111d;
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.22);
}

body.light-theme .button-primary {
    color: #ffffff;
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--surface-light);
    border-color: var(--primary);
}

/* ===== Navbar ===== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;

    height: var(--nav-height);

    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 1.1rem;
    font-weight: 800;
}

.logo-image {
    display: block;

    width: 40px;
    height: 40px;

    object-fit: contain;
    border: 2px solid var(--border);
    border-radius: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;

    list-style: none;
}

.nav-link {
    display: block;
    padding: 8px 12px;

    border-radius: 8px;

    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 650;

    transition:
        color var(--transition),
        background-color var(--transition);
}

.nav-link:hover {
    background: var(--surface-light);
    color: var(--text);
}

.theme-toggle {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;

    color: var(--text);
    cursor: pointer;

    transition:
        transform var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    background: var(--surface-light);
    border-color: var(--primary);
}

.theme-icon {
    font-size: 1.05rem;
    line-height: 1;
}

/* ===== HERO  ===== */

.hero {
    display: flex;
    align-items: center;

    min-height: calc(100vh - var(--nav-height));
    padding: 80px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    align-items: center;
    gap: 80px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 22px;

    color: var(--secondary);
    font-size: 0.86rem;
    font-weight: 750;
}

.status-dot {
    width: 9px;
    height: 9px;

    background: var(--secondary);
    border-radius: 50%;

    box-shadow: 0 0 14px rgba(253, 135, 0, 0.8);
}

.hero-title {
    max-width: 760px;
    margin-bottom: 22px;

    font-size: clamp(3rem, 8vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-title .accent {
    color: var(--primary);
}

.hero-description {
    max-width: 650px;
    margin-bottom: 32px;

    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===== Code Window ===== */

.code-window {
    position: relative;

    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);

    transform: rotate(1.5deg);

    transition:
        transform 250ms ease,
        box-shadow 250ms ease;
}

.code-window:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.code-window::before {
    position: absolute;
    inset: auto -80px -100px auto;

    width: 240px;
    height: 240px;

    background: var(--primary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;

    content: "";
}

.window-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;

    height: 46px;
    padding: 0 16px;

    background: var(--surface-light);
    border-bottom: 1px solid var(--border);
}

.window-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.window-dot.red {
    background: #ff5f56;
}

.window-dot.yellow {
    background: #ffbd2e;
}

.window-dot.green {
    background: #27c93f;
}

.window-title {
    margin-left: 8px;
    color: var(--muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
}

.code-content {
    min-height: 330px;
    padding: 28px;

    color: #c9d1d9;
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(0.78rem, 1.4vw, 0.95rem);
    line-height: 1.9;
}

body.light-theme .code-content {
    color: #24292f;
}

.code-line {
    display: block;
    white-space: pre-wrap;
}

.code-keyword {
    color: #ff7b72;
}

.code-name {
    color: #d2a8ff;
}

.code-string {
    color: #a5d6ff;
}

.code-property {
    color: #79c0ff;
}

.code-comment {
    color: var(--muted);
}

/* ===== About ===== */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 28px;
}

.about-card,
.fact-card {
    padding: 32px;
}

.about-card p {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 1.04rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card strong {
    color: var(--text);
}

.fact-list {
    display: grid;
    gap: 22px;
}

.fact {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 14px;
}

.fact-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--primary);
    font-weight: 800;
}

.fact-title {
    font-weight: 750;
}

.fact-description {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ===== Projects ===== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    position: relative;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.project-card:hover {
    transform: translateY(-7px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.project-preview {
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    display: grid;
    place-items: center;

    height: 220px;

    overflow: hidden;

    background:
        linear-gradient(135deg,
            rgba(88, 166, 255, 0.16),
            rgba(253, 135, 0, 0.09)),
        var(--surface-light);

    border-bottom: 1px solid var(--border);
}

.project-preview::before {
    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px,
            transparent 1px),
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px);

    background-size: 22px 22px;

    content: "";
}

.project-image {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .35s ease,
        filter .35s ease;
}

.project-card:hover .project-image {
    transform: scale(1.04);
}

.project-symbol {
    position: relative;
    z-index: 1;

    color: var(--text);
    font-family: Consolas, monospace;
    font-size: clamp(2rem, 7vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.08em;

    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-body {
    display: flex;
    flex: 1;
    flex-direction: column;

    padding: 28px;
}

.project-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;

    margin-bottom: 12px;
}

.project-title {
    margin-right: auto;

    font-size: 1.35rem;
    line-height: 1.3;
}

.version {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;

    color: var(--muted);

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;

    transition:
        color var(--transition),
        border-color var(--transition),
        background-color var(--transition);
}

.version:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.featured-badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    background: rgba(253, 135, 0, 0.12);
    border: 1px solid rgba(253, 135, 0, 0.32);
    border-radius: 999px;

    color: var(--secondary);

    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.project-description {
    margin-bottom: 22px;
    color: var(--muted);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: auto;
    margin-bottom: 24px;

    list-style: none;
}

.tag {
    padding: 5px 10px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--muted);
    font-family: Consolas, monospace;
    font-size: 0.76rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-link {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 750;
}

.project-link:hover {
    text-decoration: underline;
}

/* ===== Skills ===== */

.skills-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.skill-group {
    padding: 26px;
}

.skill-group-title {
    margin-bottom: 18px;
    font-size: 1.05rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    list-style: none;
}

.skill {
    padding: 8px 12px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--muted);
    font-size: 0.87rem;
    font-weight: 650;

    transition:
        color var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.skill:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--text);
}

/* ===== Contact ===== */

.contact-card {
    position: relative;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;

    overflow: hidden;

    padding: clamp(32px, 6vw, 64px);
}

.contact-card::after {
    position: absolute;
    top: -120px;
    right: -100px;

    width: 300px;
    height: 300px;

    background: var(--primary);
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.12;

    content: "";
}

.contact-content {
    position: relative;
    z-index: 1;
}

.contact-title {
    margin-bottom: 14px;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.1;
}

.contact-description {
    max-width: 680px;
    color: var(--muted);
}

.contact-actions {
    position: relative;
    z-index: 1;

    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===== Footer ===== */

.footer {
    padding: 30px 0;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 0.88rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-link {
    color: var(--primary);
    font-weight: 700;
}

/* ===== Entrance Animation ===== */

.reveal {
    opacity: 0;
    transform: translateY(28px);

    transition:
        opacity 600ms ease,
        transform 600ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Layout ===== */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 55px;
    }

    .hero {
        padding-top: 70px;
    }

    .code-window {
        width: min(100%, 620px);
        margin-inline: auto;
    }

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

    .skills-layout {
        grid-template-columns: 1fr 1fr;
    }

    .contact-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    :root {
        --nav-height: 64px;
    }

    .container {
        width: min(calc(100% - 28px), var(--page-width));
    }

    .section {
        padding: 76px 0;
    }

    .logo-text {
        display: none;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 8px;
        font-size: 0.82rem;
    }

    .hero-title {
        font-size: clamp(2.8rem, 15vw, 4.4rem);
    }

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

    .skills-layout {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nav-link.skills-link {
        display: none;
    }

    .hero-actions,
    .contact-actions {
        flex-direction: column;
    }

    .hero-actions .button,
    .contact-actions .button {
        width: 100%;
    }

    .project-top {
        flex-direction: column;
    }

    .code-content {
        min-height: 280px;
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
