:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.74);
    --text: #e5edf7;
    --muted: #a8b3c7;
    --soft: #64748b;
    --line: rgba(148, 163, 184, 0.18);
    --primary: #5eead4;
    --primary-strong: #22d3ee;
    --orange: #fdba74;
    --card-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 12px;
    --shell: 760px;
    --nav-shell: 1180px;
    --header-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse 80% 70% at 50% -20%, rgba(14, 165, 233, 0.28), transparent 64%),
        linear-gradient(180deg, #020617 0%, #030712 48%, #020617 100%);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

body.menu-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

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

button {
    font: inherit;
}

.shell {
    width: min(var(--shell), calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: var(--header-height);
    background: rgba(2, 6, 23, 0.56);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(18px);
    transition: border-color 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
    background: rgba(2, 6, 23, 0.82);
    border-color: var(--line);
}

.nav {
    width: min(var(--nav-shell), calc(100% - 32px));
    height: 100%;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
    align-items: center;
    gap: 18px;
    position: relative;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.brand {
    color: var(--primary);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}

.nav > .brand {
    grid-column: 1;
    justify-self: start;
}

.nav-actions {
    display: flex;
    align-items: center;
    grid-column: 3;
    justify-self: end;
    gap: 12px;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #dbe4f0;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-icon:hover,
.nav-icon:focus-visible {
    color: #ffffff;
    border-color: rgba(94, 234, 212, 0.52);
    background: rgba(30, 41, 59, 0.94);
    transform: translateY(-2px);
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    overflow: visible;
}

.nav-icon .brand-svg {
    fill: currentColor;
    stroke: none;
}

.nav-icon .line-svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 22px;
    justify-content: center;
    grid-column: 2;
}

.nav-menu a {
    position: relative;
    color: #dbe4f0;
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 180ms ease;
}

.nav-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary-strong);
    transition: right 200ms ease;
}

.nav-menu a:hover,
.nav-menu a.is-active {
    color: #ffffff;
}

.nav-menu a:hover::after,
.nav-menu a.is-active::after {
    right: 0;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.82);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle svg,
.scroll-link svg,
.timeline-icon svg,
.text-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0 78px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.hero-avatar {
    width: 128px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(94, 234, 212, 0.36);
    background: var(--bg-soft);
    box-shadow: 0 0 0 8px rgba(94, 234, 212, 0.06), var(--card-shadow);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-kicker {
    margin: 0;
    color: #e2e8f0;
    font-size: clamp(2rem, 7vw, 3.7rem);
    font-weight: 900;
    line-height: 1.05;
}

.hero-kicker span {
    color: var(--primary);
}

.hero-role {
    width: max-content;
    margin: 6px 0 0;
    background: linear-gradient(110deg, #b6eaff, 45%, #0e7490, 55%, #b6eaff);
    background-size: 250% 100%;
    background-clip: text;
    color: transparent;
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 800;
    animation: shine 5s linear infinite;
}

.hero h1 {
    margin: 34px 0 0;
    color: #dbeafe;
    font-size: clamp(1.3rem, 3vw, 1.65rem);
    line-height: 1.45;
    text-wrap: pretty;
}

.hero-text {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    text-wrap: pretty;
}

.social-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0;
    margin: 34px 0 0;
    list-style: none;
    margin-left: -46px;
}

.pill-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 46px;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72)),
        rgba(15, 23, 42, 0.86);
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 16px 48px rgba(0, 0, 0, 0.2);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.pill-link:hover,
.pill-link:focus-visible {
    color: #ffffff;
    border-color: rgba(94, 234, 212, 0.58);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.82)),
        rgba(15, 23, 42, 0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 18px 54px rgba(34, 211, 238, 0.12);
    transform: translateY(-2px);
}

.pill-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    overflow: visible;
}

.pill-link .brand-svg {
    fill: currentColor;
    stroke: none;
}

.pill-link .line-svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scroll-link {
    position: absolute;
    left: 50%;
    bottom: 26px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 800;
    transform: translateX(-50%);
    animation: bounce 1.5s ease-in-out infinite;
}

.section {
    padding: 88px 0;
    scroll-margin-top: calc(var(--header-height) + 26px);
}

.section h2,
.section-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(2rem, 5vw, 2.5rem);
    line-height: 1.1;
}

.section-heading {
    margin-bottom: 30px;
}

.section-heading p {
    margin: 16px 0 0;
    color: var(--muted);
    text-wrap: pretty;
}

.timeline {
    position: relative;
    padding: 0;
    margin: 34px 0 0 12px;
    border-left: 1px solid rgba(148, 163, 184, 0.34);
    list-style: none;
}

.timeline-item {
    position: relative;
    padding: 0 0 34px 34px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    top: 2px;
    left: -13px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #334155;
    color: #ccfbf1;
    box-shadow: 0 0 0 8px var(--bg);
}

.timeline-icon svg {
    width: 15px;
    height: 15px;
}

.timeline h3 {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    color: var(--primary);
    font-size: 1.08rem;
    line-height: 1.35;
}

.timeline h3 span {
    color: var(--orange);
    font-size: 0.95rem;
    font-weight: 700;
}

.timeline time {
    display: block;
    margin-top: 4px;
    color: #b6eaff;
    font-size: 0.9rem;
}

.timeline p {
    margin: 10px 0 0;
    color: var(--muted);
}

.projects-list,
.article-list {
    display: grid;
    gap: 18px;
}

.project-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--card-shadow);
    transition: transform 180ms ease, border-color 180ms ease;
}

.project-card:hover {
    border-color: rgba(94, 234, 212, 0.4);
    transform: translateY(-4px) scale(1.01);
}

.project-visual {
    position: relative;
    min-height: 128px;
    overflow: hidden;
    border-radius: 10px;
    background:
        radial-gradient(circle at 30% 20%, rgba(94, 234, 212, 0.2), transparent 35%),
        #020617;
}

.visual-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 10px;
    padding: 20px;
}

.visual-dashboard span {
    border-radius: 8px 8px 0 0;
    background: var(--primary);
}

.visual-dashboard span:nth-child(1) { height: 45%; }
.visual-dashboard span:nth-child(2) { height: 84%; background: var(--orange); }
.visual-dashboard span:nth-child(3) { height: 64%; background: #38bdf8; }

.visual-site,
.visual-app {
    padding: 18px;
}

.visual-site span,
.visual-app span {
    display: block;
    border-radius: 999px;
}

.visual-site span:nth-child(1) {
    height: 44px;
    border-radius: 10px;
    background: #1e293b;
}

.visual-site span:nth-child(2) {
    width: 72%;
    height: 12px;
    margin-top: 18px;
    background: var(--primary);
}

.visual-site span:nth-child(3) {
    width: 48%;
    height: 12px;
    margin-top: 10px;
    background: var(--orange);
}

.visual-app {
    display: grid;
    gap: 10px;
}

.visual-app span {
    min-height: 26px;
    background: #1e293b;
}

.visual-app span:nth-child(2) {
    background: var(--primary);
}

.project-info h3,
.article-card h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.16rem;
    line-height: 1.25;
}

.project-info p,
.article-card p {
    margin: 9px 0 0;
    color: var(--muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
}

.chip-list li,
.article-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 750;
}

.about-grid {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-top: 30px;
}

.about-photo {
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: var(--card-shadow);
}

.about-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
}

.about-copy p {
    margin: 0 0 16px;
    color: var(--muted);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 850;
}

.text-link svg {
    width: 18px;
    height: 18px;
}

.article-card {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--card-shadow);
    transition: transform 180ms ease;
}

.article-card:hover {
    transform: translateY(-3px) scale(1.01);
}

.article-date {
    color: #b6eaff;
    font-size: 0.84rem;
    font-weight: 800;
}

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

.tech-card {
    min-width: 0;
    min-height: 292px;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 20% 0%, rgba(94, 234, 212, 0.12), transparent 42%),
        rgba(0, 0, 0, 0.58);
    box-shadow: var(--card-shadow);
}

.tech-card:nth-child(2) {
    background:
        radial-gradient(circle at 80% 0%, rgba(251, 146, 60, 0.12), transparent 42%),
        rgba(0, 0, 0, 0.58);
}

.tech-card:nth-child(3) {
    background:
        radial-gradient(circle at 20% 0%, rgba(250, 204, 21, 0.11), transparent 42%),
        rgba(0, 0, 0, 0.58);
}

.tech-card:nth-child(4) {
    background:
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), transparent 42%),
        rgba(0, 0, 0, 0.58);
}

.tech-card h3 {
    margin: 0 0 28px;
    color: #dbeafe;
    font-size: clamp(1.9rem, 5vw, 2.45rem);
    line-height: 1;
    text-align: center;
}

.tech-card:nth-child(1) h3 { color: #9ff4ed; }
.tech-card:nth-child(2) h3 { color: #e2e8f0; }
.tech-card:nth-child(3) h3 { color: #fecaca; }
.tech-card:nth-child(4) h3 { color: #c9e6ff; }

.tech-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 24px 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tech-list-small {
    grid-template-columns: repeat(2, minmax(86px, 1fr));
}

.tech-list li {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.tech-list img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.github-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
}

.github-icon img {
    width: 44px;
    height: 44px;
}

.security-grid {
    display: grid;
    gap: 22px;
}

.security-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--card-shadow);
    transition: border-color 180ms ease, transform 180ms ease;
}

.security-card:hover,
.security-card:focus-within {
    border-color: rgba(94, 234, 212, 0.52);
    transform: translateY(-3px);
}

.security-card h3 {
    margin: 0;
    padding: 22px 22px 0;
    color: var(--primary);
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    line-height: 1.15;
}

.security-shot {
    margin: 0;
    padding: 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(94, 234, 212, 0.12), transparent 38%),
        rgba(2, 6, 23, 0.72);
    border-bottom: 1px solid var(--line);
}

.security-shot img {
    width: 100%;
    border-radius: 10px;
}

.security-copy {
    max-height: 0;
    overflow: hidden;
    padding: 22px;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 240ms ease, opacity 180ms ease, transform 180ms ease;
}

.security-card:hover .security-copy,
.security-card:focus-within .security-copy {
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
}

.security-copy p {
    max-width: 66ch;
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.96rem, 2.5vw, 1.05rem);
    text-wrap: pretty;
}

.site-footer {
    padding: 42px 0;
    border-top: 1px solid var(--line);
}

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

.footer-inner p {
    margin: 0;
    color: var(--soft);
    font-size: 0.92rem;
}

@keyframes shine {
    to {
        background-position: -200% center;
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, -8px);
    }
}

@media (max-width: 1180px) {
    .nav {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nav-actions {
        grid-column: 2;
    }

    .nav-toggle {
        display: grid;
    }

    .nav-menu {
        position: fixed;
        inset: var(--header-height) 16px auto;
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(2, 6, 23, 0.96);
        box-shadow: var(--card-shadow);
        justify-content: stretch;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .nav-menu.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-menu a {
        padding: 10px;
    }

    .nav-menu a::after {
        display: none;
    }
}

@media (max-width: 860px) {
    .hero-inner,
    .about-grid,
    .project-card,
    .article-card {
        grid-template-columns: 1fr;
    }

    .hero-avatar {
        width: 112px;
    }

    .project-visual {
        min-height: 170px;
    }

    .article-card {
        align-items: start;
    }

    .article-tag {
        width: max-content;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 28px, var(--shell));
    }

    .nav {
        width: min(100% - 28px, var(--nav-shell));
        gap: 12px;
    }

    .nav-actions {
        gap: 10px;
    }

    .brand {
        font-size: 1.35rem;
    }

    .nav-social {
        gap: 6px;
    }

    .nav-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .nav-icon svg {
        width: 16px;
        height: 16px;
    }

    .hero {
        min-height: auto;
        padding: 112px 0 72px;
    }

    .hero-inner {
        gap: 18px;
    }

    .social-list {
        display: grid;
        justify-content: stretch;
        width: 100%;
        margin: 28px 0 0;
    }

    .pill-link {
        width: 100%;
        min-height: 48px;
        padding-inline: 16px;
    }

    .scroll-link {
        display: none;
    }

    .section {
        padding: 68px 0;
    }

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

    .tech-card {
        min-height: 0;
        padding: 24px 18px;
    }

    .tech-list {
        grid-template-columns: repeat(2, minmax(92px, 1fr));
    }

    .tech-list-small {
        grid-template-columns: repeat(2, minmax(92px, 1fr));
    }

    .security-copy {
        max-height: none;
        opacity: 1;
        transform: none;
    }

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

@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;
    }
}
