/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Design tokens (dark theme) */
:root {
    --bg: #0b0f17;
    --bg-alt: #10151f;
    --surface: #151b28;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8edf4;
    --text-muted: #94a3b8;
    --accent: #4ade80;
    --accent-soft: rgba(74, 222, 128, 0.12);
    color-scheme: dark;
}

html {
    scroll-behavior: smooth;
}

/* чтобы якорные секции не уезжали под фиксированный хедер */
section[id] {
    scroll-margin-top: 90px;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    /* лёгкое зелёное свечение сверху поверх базового фона */
    background-image: radial-gradient(900px 480px at 70% -10%, rgba(74, 222, 128, 0.08), transparent 65%);
    background-repeat: no-repeat;
}

::selection {
    background: var(--accent);
    color: #0b0f17;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--narrow {
    max-width: 860px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(16, 21, 31, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.cta-button {
    background: var(--accent);
    color: #f8fafc;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s;
}

.cta-button:hover {
    background: #3ac271;
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 130px 0 80px;
    overflow: hidden;
}

.hero-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-decor .glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.glow-1 {
    width: 520px;
    height: 520px;
    top: -160px;
    right: -80px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.16), transparent 70%);
    animation: pulse 9s ease-in-out infinite;
}

.glow-2 {
    width: 420px;
    height: 420px;
    bottom: -180px;
    left: -120px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.10), transparent 70%);
    animation: pulse 11s ease-in-out infinite reverse;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
}

@keyframes pulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 60px;
}

.hero-content {
    max-width: 640px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 28px;
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 100px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: ping 2s ease-out infinite;
}

@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -1px;
    color: #f8fafc;
    margin-bottom: 22px;
}

.grad-text {
    background: linear-gradient(100deg, var(--accent) 10%, #38bdf8 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 34px;
    line-height: 1.7;
    max-width: 520px;
}

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

/* Чек-лист преимуществ под кнопками */
.hero-checks {
    display: flex;
    gap: 12px 28px;
    flex-wrap: wrap;
    margin-top: 26px;
    list-style: none;
    padding: 0;
}

.hero-checks li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-checks span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Строка основного стека */
.hero-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    margin-top: 24px;
    padding: 12px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.hero-stack-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.hero-stack-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero-stack code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #c9d4e4;
}

.hero-meta {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    list-style: none;
}

.hero-meta li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-meta strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}

.hero-meta span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Визуал: окно с кодом */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.9s ease-out 0.15s backwards;
}

.code-window {
    --tilt-x: 3deg;
    --tilt-y: -6deg;
    width: 100%;
    max-width: 480px;
    background: rgba(13, 18, 28, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(74, 222, 128, 0.06), 0 0 50px rgba(74, 222, 128, 0.07);
    overflow: hidden;
    transform: perspective(1200px) rotateY(var(--tilt-y)) rotateX(var(--tilt-x));
    transition: transform 0.18s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

.hero-visual:hover .code-window {
    transform: perspective(1200px) rotateY(var(--tilt-y)) rotateX(var(--tilt-x)) translateY(-6px);
}

.code-window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.win-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.win-dot--red { background: #ff5f57; }
.win-dot--yellow { background: #febc2e; }
.win-dot--green { background: #28c840; }

.win-title {
    margin-left: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.code-body {
    margin: 0;
    padding: 22px 24px 26px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #c9d4e4;
    overflow-x: auto;
}

.tk-kw { color: #c792ea; }
.tk-var { color: #82aaff; }
.tk-str { color: #c3e88d; }
.tk-bool { color: #f78c6c; }

.float-chip {
    position: absolute;
    padding: 9px 16px;
    background: rgba(21, 27, 40, 0.92);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    animation: floaty 5s ease-in-out infinite;
    /* параллакс за мышкой: свойство translate не конфликтует с transform из floaty */
    translate: var(--chip-x, 0px) var(--chip-y, 0px);
    transition: translate 0.25s ease-out;
}

.chip-1 { top: -18px; right: 8%; animation-delay: 0s; }
.chip-2 { bottom: 24px; left: -10px; animation-delay: 1.2s; }
.chip-3 { bottom: -16px; right: 14%; animation-delay: 2.4s; color: #38bdf8; }

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 1;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    animation: bounce 2.2s ease-in-out infinite;
    transition: color 0.3s, border-color 0.3s;
}

.scroll-hint:hover {
    color: var(--accent);
    border-color: rgba(74, 222, 128, 0.4);
}

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

/* Общие картинки-заглушки (используются в «Обо мне») */
.image-placeholder {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #151b28 0%, #1b2334 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(74, 222, 128, 0.07) 50%, transparent 70%);
}

/* Бургер-меню (мобилки) */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links.nav-links--open li { border-bottom: 1px solid var(--border); }
.nav-links.nav-links--open li:last-child { border-bottom: none; }

.nav-links.nav-links--open a {
    display: block;
    padding: 12px 0;
}

.nav-links a.nav-active {
    color: var(--accent);
}

.nav-links a.nav-active::after {
    width: 100%;
}

/* Кнопка «наверх» */
.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.2rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s, border-color 0.3s;
}

.to-top.to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    border-color: rgba(74, 222, 128, 0.4);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #f8fafc;
    box-shadow: 0 10px 26px rgba(74, 222, 128, 0.22);
}

.btn-primary:hover {
    background: #3ac271;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(74, 222, 128, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    transform: translateY(-2px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 20px;
    text-align: center;
}

.section-title--left {
    text-align: left;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

/* About Section */
.about {
    padding: 80px 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    text-align: center;
}

.about-content {
    padding-right: 30px;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.stat {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 14px;
    flex: 1;
    min-width: 120px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
    position: relative;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Факты в блоке «Обо мне» */
.about-facts {
    list-style: none;
    margin: 0 0 10px;
    display: grid;
    gap: 10px;
}

.about-facts li {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
}

.about-facts span {
    color: var(--text-muted);
    flex-shrink: 0;
}

.about-facts strong {
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.avatar-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 4.5rem;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 40px rgba(74, 222, 128, 0.45);
}

/* Services Section */
.services {
    padding: 80px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(74, 222, 128, 0.35);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(74, 222, 128, 0.08);
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: var(--accent);
    margin-bottom: 18px;
    transition: background 0.3s, border-color 0.3s;
}

.service-icon svg {
    width: 26px;
    height: 26px;
}

.service-card:hover .service-icon {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.45);
}

.service-card h3 {
    font-size: 1.15rem;
    color: #f8fafc;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Projects Section */
.projects {
    padding: 80px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(74, 222, 128, 0.35);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(74, 222, 128, 0.12);
}

.project-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #0f1520 0%, #16203a 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow: hidden;
}

/* Скриншот/обложка проекта: заполняет всю площадь, аккуратно обрезается */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

.project-cover {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(74, 222, 128, 0.55);
    text-shadow: 0 0 30px rgba(74, 222, 128, 0.25);
}

.project-year {
    position: absolute;
    top: 14px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(11, 15, 23, 0.6);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 9px;
}

.project-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 1.3rem;
    color: #f8fafc;
    margin-bottom: 10px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-results {
    list-style: none;
    margin: 0 0 18px;
    display: grid;
    gap: 8px;
}

.project-results li {
    position: relative;
    padding-left: 20px;
    font-size: 0.86rem;
    color: #cbd5e1;
}

.project-results li::before {
    content: '↗';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 700;
}

.project-links {
    margin-top: auto;
    padding-top: 6px;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.project-link:hover {
    opacity: 0.75;
}

.project-tags {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(74, 222, 128, 0.25);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Skills Section */
.skills {
    padding: 80px 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category h3 {
    font-size: 1.2rem;
    color: #f8fafc;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.skill-bar {
    margin-bottom: 20px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text);
}

.skill-progress {
    position: relative; /* фикс: якорь для ::after, иначе он растягивался на весь экран */
    height: 8px;
    background: #1f2937;
    border-radius: 4px;
    overflow: hidden;
}

/* Полоса растёт до значения из CSS-переменной --w, заданной в HTML */
.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(90deg, var(--accent), #38bdf8);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.55);
    border-radius: 4px;
    animation: progressBar 1.5s ease-out forwards;
}

@keyframes progressBar {
    from { width: 0; }
}

.skill-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.skills-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 46px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.skills-extra-label {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-right: 6px;
}

/* Experience Section */
.experience {
    padding: 80px 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 34px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.5), rgba(74, 222, 128, 0.05));
}

.timeline-item {
    position: relative;
    padding-bottom: 46px;
}

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

.timeline-dot {
    position: absolute;
    left: -34px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

.timeline-period {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 6px;
    padding: 4px 12px;
    margin-bottom: 14px;
}

.timeline-body h3 {
    font-size: 1.15rem;
    color: #f8fafc;
    margin-bottom: 10px;
}

.timeline-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 14px;
}

.timeline-points {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.timeline-points li {
    position: relative;
    padding-left: 18px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.timeline-points li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-tags {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}

/* Reviews Section */
.reviews {
    padding: 80px 0;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.review-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s, border-color 0.3s;
}

.review-card:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 222, 128, 0.3);
}

.review-card blockquote {
    color: #cbd5e1;
    font-size: 0.98rem;
    line-height: 1.7;
}

.review-card figcaption {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: auto;
}

.review-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.review-author {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.review-author strong {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.95rem;
}

.review-author em {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: normal;
}

/* FAQ Section */
.faq {
    padding: 80px 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.3s;
}

.faq-item[open] {
    border-color: rgba(74, 222, 128, 0.35);
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 48px 18px 20px;
    font-weight: 600;
    color: #f8fafc;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '–';
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item p {
    padding: 0 20px 20px;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.7;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background: var(--bg);
}

.contact-text {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 26px;
}

.contact-info h3 {
    color: #f8fafc;
    font-size: 1.15rem;
    margin-bottom: 20px;
}

.contact-list {
    list-style: none;
    display: grid;
    gap: 14px;
}

.contact-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.93rem;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.contact-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.contact-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.contact-list a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-list a:hover {
    opacity: 0.75;
}

.contact-list span:last-child {
    color: var(--text);
    text-align: right;
}

.contact-note {
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.contact-form {
    width: 100%;
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form .btn {
    align-self: flex-start;
}

/* Footer */
.footer {
    padding: 50px 0 30px;
    background: #080b12;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--border);
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 14px;
}

.footer-brand p {
    font-size: 0.92rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col h4 {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.3s;
    width: fit-content;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 26px;
    font-size: 0.88rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-made {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 70px;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
        margin: 0 auto;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions,
    .hero-meta {
        justify-content: center;
    }

    .hero-checks {
        justify-content: center;
        gap: 10px 20px;
    }

    .hero-stack {
        display: flex;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .hero-badge {
        margin-left: auto;
        margin-right: auto;
    }

    .code-window {
        transform: none !important;
        --tilt-x: 0deg;
        --tilt-y: 0deg;
    }

    .hero-visual:hover .code-window {
        transform: translateY(-6px);
    }

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

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

    .latest-posts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .burger {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    /* Открытое меню — только в мобильной раскладке, иначе при ресайзе оно «зависает» поверх десктопной шапки */
    .nav-links.nav-links--open {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(16, 21, 31, 0.98);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(10px);
        padding: 10px 20px 16px;
    }

    .hero {
        padding: 120px 0 70px;
    }

    .hero-meta {
        gap: 24px 32px;
        margin-top: 36px;
    }

    .hero-meta strong {
        font-size: 1.35rem;
    }

    .code-body {
        font-size: 0.78rem;
        padding: 18px 18px 22px;
    }

    .float-chip,
    .scroll-hint {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .about-content {
        padding-right: 0;
        margin-top: 40px;
    }

    .about-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
    }

    .about-facts strong {
        text-align: left;
    }

    .about-facts li {
        flex-direction: column;
        gap: 4px;
    }

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

    .timeline {
        padding-left: 26px;
    }

    .timeline::before {
        left: 6px;
    }

    .timeline-dot {
        left: -26px;
    }

    .contact-grid {
        gap: 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .post-card {
        padding: 20px 18px;
    }

    .post-card h2 {
        font-size: 1.15rem;
    }

    .blog-page {
        padding: 110px 0 60px;
    }
}

/* Фото в блоке «Обо мне»: крупное на десктопе, адаптивное на мобилке */
.about-image img {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    border-radius: 24px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Blog
   ============================================================ */

/* Компактная шапка блога: фиксированный хедер занимает ~80px */
.blog-page {
    padding: 130px 0 80px;
    min-height: 100vh;
}

.blog-hero {
    margin-bottom: 50px;
}

.blog-title {
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.blog-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
    margin-bottom: 18px;
}

.blog-rss,
.blog-back {
    display: inline-block;
    margin-right: 18px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.blog-rss:hover,
.blog-back:hover {
    opacity: 0.75;
}

/* Список постов */
.post-list {
    display: grid;
    gap: 24px;
    max-width: 860px;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 26px 28px;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(74, 222, 128, 0.3);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(74, 222, 128, 0.08);
}

.post-card h2 {
    font-size: 1.35rem;
    margin: 10px 0 12px;
    line-height: 1.35;
}

.post-card h2 a {
    color: #f8fafc;
    text-decoration: none;
    transition: color 0.3s;
}

.post-card h2 a:hover {
    color: var(--accent);
}

.post-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.post-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Страница поста */
.post-body {
    max-width: 760px;
    margin: 0 auto;
}

.post-back {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.post-back:hover {
    opacity: 0.75;
}

.post-body h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 18px;
}

.post-body .post-meta {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.post-body h2 {
    font-size: 1.5rem;
    color: #f8fafc;
    margin: 44px 0 16px;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 1.2rem;
    color: #f8fafc;
    margin: 32px 0 12px;
}

.post-body p {
    color: #cbd5e1;
    line-height: 1.75;
    margin-bottom: 18px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 18px 24px;
    color: #cbd5e1;
    line-height: 1.75;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body a {
    color: var(--accent);
}

/* Код в постах: тёмный фон как у .code-window, скролл по горизонтали,
   чтобы длинные строки не распирали мобильную вёрстку */
.post-body pre {
    background: rgba(13, 18, 28, 0.9);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 0 0 20px;
}

.post-body pre code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #c9d4e4;
    background: none;
    padding: 0;
}

.post-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.15);
    color: #a7f3d0;
    padding: 2px 7px;
    border-radius: 5px;
}

.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    margin: 0 0 20px;
    color: var(--text-muted);
    font-style: italic;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.post-cta {
    margin-top: 48px;
    padding: 24px 26px;
    background: var(--accent-soft);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 12px;
}

.post-cta p {
    margin: 0;
    color: var(--text);
}

.post-back--bottom {
    margin-top: 28px;
    margin-bottom: 0;
}

/* «Latest writing» на главной: 3 карточки в ряд */
.latest-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.latest-posts .post-card p {
    margin-bottom: 0;
}

.latest-more {
    text-align: center;
}

.latest-more a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.latest-more a:hover {
    opacity: 0.75;
}

/* end of file */
