:root {
    --bg: #fbfdff;
    --ink: #0b1a33;
    --muted: #5a6880;
    --blue: #1677ff;
    --blue-soft: #eaf3ff;
    --line: #d9e2ef;
    --card: rgba(255, 255, 255, 0.86);
    --shadow: 0 22px 70px rgba(28, 87, 162, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 64% 14%, rgba(22, 119, 255, 0.22), transparent 24rem),
        radial-gradient(circle at 20% 44%, rgba(22, 119, 255, 0.08), transparent 28rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Tahoma, sans-serif;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

.scroll-view {
    position: relative;
    display: grid;
    min-height: 100vh;
    scroll-snap-align: start;
    border-bottom: 1px solid var(--line);
    padding: clamp(42px, 6vw, 84px) clamp(22px, 8vw, 150px);
}

.section-index {
    position: absolute;
    top: 48px;
    left: clamp(20px, 3vw, 44px);
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
}

.section-index::after {
    width: 38px;
    height: 1px;
    background: var(--muted);
    content: "";
}

.section-dots {
    position: fixed;
    top: 50%;
    right: clamp(18px, 4vw, 58px);
    z-index: 30;
    display: grid;
    gap: 20px;
    transform: translateY(-50%);
}

.section-dots a {
    width: 11px;
    height: 11px;
    border: 1px solid #677792;
    border-radius: 50%;
    background: transparent;
}

.section-dots a.active {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: 0 0 0 6px rgba(22, 119, 255, 0.12);
}

.intro-view {
    align-items: center;
}

.intro-content {
    display: grid;
    grid-template-columns: minmax(0, 0.94fr) minmax(280px, 420px);
    gap: clamp(42px, 8vw, 130px);
    width: min(1000px, 100%);
    margin: 0 auto;
    align-items: center;
}

.kicker,
.section-title p {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(58px, 8vw, 92px);
    letter-spacing: 0;
    line-height: 0.9;
}

h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(34px, 5vw, 54px);
    letter-spacing: 0;
    line-height: 1;
}

.role-badge {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 22px 0 0;
    color: var(--blue);
    font-weight: 800;
}

.role-badge::before {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
}

.intro-summary {
    max-width: 520px;
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 34px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 8px;
    padding: 0 24px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.primary-button {
    border: 1px solid var(--blue);
    background: var(--blue);
    color: #fff;
    box-shadow: 0 14px 34px rgba(22, 119, 255, 0.22);
}

.secondary-button {
    border: 1px solid #c8d4e5;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
}

.portrait-card {
    position: relative;
    margin: 0;
}

.portrait-card::after {
    position: absolute;
    right: -70px;
    bottom: 22px;
    width: 104px;
    height: 104px;
    background-image: radial-gradient(rgba(22, 119, 255, 0.24) 1px, transparent 1px);
    background-size: 12px 12px;
    content: "";
}

.portrait-card img {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 0.78;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 28px 70px rgba(11, 26, 51, 0.18);
}

.scroll-cue {
    position: absolute;
    bottom: 24px;
    left: 50%;
    width: 22px;
    height: 22px;
    border-right: 2px solid #708098;
    border-bottom: 2px solid #708098;
    transform: translateX(-50%) rotate(45deg);
}

.scroll-cue.up {
    transform: translateX(-50%) rotate(225deg);
}

.section-title {
    align-self: start;
    margin: 0 auto 34px;
    text-align: center;
}

.section-title span {
    display: block;
    margin-top: 12px;
    color: var(--muted);
}

.projects-view,
.tech-view,
.certificates-view,
.contact-view {
    align-content: center;
}

.timeline {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 74px 1fr;
    gap: 20px;
    width: min(960px, 100%);
    margin: 0 auto;
}

.timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(var(--line), var(--blue), var(--line));
    content: "";
    transform: translateX(-50%);
}

.project-card {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 18px;
    min-height: 132px;
    padding: 22px;
    border: 1px solid #dfe7f3;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.project-card.left {
    grid-column: 1;
}

.project-card.right {
    grid-column: 3;
}

.project-card.left::after,
.project-card.right::after {
    position: absolute;
    top: 48px;
    width: 19px;
    height: 19px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.45);
    content: "";
}

.project-card.left::after {
    right: -50px;
}

.project-card.right::after {
    left: -50px;
}

.project-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.project-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.project-heading h3 {
    margin: 0;
    font-size: 19px;
}

.project-heading span {
    color: var(--blue);
    font-weight: 900;
}

.project-body p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

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

.project-body li {
    border-radius: 999px;
    background: #f1f5fa;
    padding: 6px 10px;
    color: #405069;
    font-size: 12px;
}

.project-card > a {
    position: absolute;
    inset: 0;
}

.tech-grid {
    display: grid;
    gap: 18px;
    width: min(940px, 100%);
    margin: 0 auto;
}

.tech-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 12px;
}

.tech-label,
.tech-pill {
    min-height: 68px;
    border: 1px solid #dfe7f3;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 36px rgba(28, 87, 162, 0.06);
}

.tech-label {
    display: grid;
    place-items: center start;
    padding: 0 26px;
    color: var(--ink);
    font-weight: 900;
}

.tech-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 12px;
}

.tech-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    color: #283752;
}

.tech-pill span {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.certificate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    width: min(980px, 100%);
    margin: 0 auto;
}

.certificate-card {
    padding: 16px 16px 28px;
    border: 1px solid #dfe7f3;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    text-align: center;
    box-shadow: var(--shadow);
}

.certificate-image {
    display: grid;
    min-height: 190px;
    place-items: center;
    background: linear-gradient(135deg, #fff, #f9fbff);
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.certificate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-card h3 {
    margin: 24px 0 8px;
    font-size: 20px;
}

.certificate-card p {
    margin: 0;
    color: var(--muted);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: min(920px, 100%);
    margin: 0 auto;
}

.contact-card {
    display: grid;
    min-height: 170px;
    justify-items: center;
    gap: 10px;
    border: 1px solid #dfe7f3;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    padding: 26px 16px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.contact-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 900;
}

.contact-card strong {
    font-size: 18px;
}

.contact-card small {
    max-width: 100%;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.contact-card em {
    color: var(--blue);
    font-style: normal;
    font-weight: 900;
}

.admin-dialog {
    width: min(460px, calc(100% - 28px));
    padding: 0;
    border: 0;
    background: transparent;
}

.admin-dialog::backdrop {
    background: rgba(11, 26, 51, 0.48);
    backdrop-filter: blur(8px);
}

.admin-card,
.editor-drawer {
    border: 1px solid #dfe7f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-card {
    position: relative;
    display: grid;
    gap: 16px;
    padding: 30px;
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid #dfe7f3;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid #dfe7f3;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    color: var(--ink);
}

.admin-error {
    min-height: 20px;
    margin: 0;
    color: #a32222;
}

.editor-drawer {
    display: none;
    width: min(1080px, calc(100% - 36px));
    margin: 0 auto 60px;
    padding: 30px;
}

.editor-drawer.is-open {
    display: block;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.editor-note {
    color: var(--muted);
    line-height: 1.6;
}

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

.editor-form label:last-child {
    grid-column: 1 / -1;
}

.data-editor-label {
    margin-top: 18px;
}

.data-editor-label textarea {
    min-height: 420px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

@media (max-width: 1060px) {
    .scroll-view {
        min-height: auto;
        padding-right: 54px;
    }

    .intro-content,
    .timeline,
    .tech-row,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .project-card.left,
    .project-card.right {
        grid-column: 1;
    }

    .timeline::before,
    .project-card::after {
        display: none;
    }

    .tech-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    html {
        scroll-snap-type: none;
    }

    .section-dots {
        right: 12px;
        gap: 14px;
    }

    .scroll-view {
        padding: 76px 28px 62px 18px;
    }

    .section-index {
        top: 24px;
        left: 18px;
    }

    .intro-actions,
    .editor-actions,
    .editor-header {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .tech-items,
    .editor-form {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        gap: 14px;
    }

    h1 {
        font-size: clamp(48px, 18vw, 74px);
    }
}
