:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #6b6b6b;
    --border: #2a2a2a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.1);
    --accent-ring: rgba(99, 102, 241, 0.3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
    --header-h: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 1100px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* ── Header ── */

header {
    position: fixed;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    max-width: calc(var(--max-w) + 40px);
    margin: 0;
    background: linear-gradient(180deg, #0f0f0f 0%, #141414 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 100;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), border-radius var(--transition), transform 0.3s ease;
}

header.header--hidden {
    transform: translateY(calc(-100% - 24px));
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: height var(--transition);
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: color var(--transition), opacity 0.1s ease;
}

.logo-tld {
    font-size: 0.65em;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 1px;
}

/* ── Nav ── */

nav ul {
    display: flex;
    gap: 4px;
}

nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 450;
    color: var(--text-secondary);
    transition: all var(--transition);
}

nav a:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

@media (min-width: 768px) {
    header {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: calc(var(--max-w) + 40px);
        margin: 0 auto;
        display: flex;
        align-items: center;
        padding: 0 20px;
        height: var(--header-h);
    }

    .header-inner {
        height: auto;
        padding: 0;
        margin: 0;
        max-width: none;
        flex: 0 0 auto;
    }

    nav {
        margin-left: auto;
        max-height: none;
        overflow: visible;
        padding: 0;
        background: none;
        border: none;
        width: auto;
        border-radius: 0;
        position: static;
    }

    nav ul {
        flex-direction: row;
        opacity: 1;
        transform: none;
        padding: 0;
    }

    .header-actions {
        display: none;
    }
}

/* ── Hamburger ── */

.hamburger {
    display: none;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 102;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) { top: 5px; }
.hamburger span:nth-child(2) { top: 13px; }
.hamburger span:nth-child(3) { top: 21px; }

.hamburger.active span:nth-child(1) {
    top: 13px;
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}

.hamburger.active span:nth-child(3) {
    top: 13px;
    transform: rotate(-45deg);
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 98;
    pointer-events: none;
}

.nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Hero ── */

#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-h) + 40px) 20px 80px;
    background: radial-gradient(ellipse at 50% 40%, var(--accent-subtle) 0%, transparent 60%);
}

.hero-content {
    max-width: 720px;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-ring);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    transition: gap var(--transition);
}

.btn-small:hover {
    gap: 8px;
}

/* ── Sections ── */

section {
    padding: 80px 20px;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--transition);
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.section-header h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ── Portfolio ── */

#portfolio {
    padding-top: calc(var(--header-h) + 40px);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    max-width: var(--max-w);
    margin: 0 auto;
}

.portfolio-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all var(--transition);
}

.portfolio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--text-muted);
}

.portfolio-card a {
    display: block;
}

.portfolio-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-bottom: 1px solid var(--border);
}

.portfolio-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0.3px);
    transition: transform 0.5s ease, filter 0.3s ease;
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.04);
    filter: blur(0);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay span {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.portfolio-card-footer {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portfolio-card-footer h3 {
    font-size: 1rem;
    font-weight: 550;
    letter-spacing: -0.01em;
}

.portfolio-badge {
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

.portfolio-badge[data-type="business"] {
    color: #34d399;
}

.portfolio-badge[data-type="example"] {
    color: var(--text-muted);
}

/* ── Packages ── */

#packages {
    padding-top: calc(var(--header-h) + 40px);
}

.packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: var(--max-w);
    margin: 0 auto;
}

.loading-packages {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 0.9rem;
}

.package-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.package-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--text-muted);
}

.package-card.popular {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.package-card.popular:hover {
    box-shadow: 0 12px 40px var(--accent-ring);
    border-color: var(--accent);
}

.package-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 100px;
    white-space: nowrap;
}

.package-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.package-price {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.package-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.package-features {
    flex: 1;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.package-features li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.package-features li i {
    width: 16px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.package-features li .fa-check {
    color: #22c55e;
}

.package-features li .fa-times {
    color: var(--text-muted);
}

.package-features li.not-included {
    color: var(--text-muted);
    text-decoration: line-through;
}

/* ── Contact ── */

#contact {
    border-bottom: none;
    padding-top: calc(var(--header-h) + 40px);
}

.contact-card {
    max-width: var(--max-w);
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.contact-item + .contact-item {
    border-top: 1px solid var(--border);
}

.contact-item i {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.contact-item a {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
    transition: color var(--transition);
}

.contact-item a:hover {
    color: var(--accent-hover);
}

/* ── Footer ── */

footer {
    border-top: 1px solid var(--border);
    transition: border-color var(--transition);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.footer-inner p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.footer-github {
    position: relative;
    padding-left: 22px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer-github:hover {
    color: var(--text-primary);
}

.footer-github i {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.back-to-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.back-to-top:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
}

/* ── Animations ── */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */

@media (max-width: 767px) {
    .hamburger {
        display: block;
    }

    nav {
        padding: 0 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s ease, padding 0.2s ease;
        position: static;
        background: none;
        border: none;
        width: auto;
        border-radius: 0;
    }

    nav.active {
        max-height: 400px;
        padding: 0 20px 16px;
    }

    nav ul {
        flex-direction: column;
        gap: 2px;
        padding: 0;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.25s ease 0.15s, transform 0.25s ease 0.15s;
    }

    nav.active ul {
        opacity: 1;
        transform: translateY(0);
    }

    nav a {
        display: block;
        padding: 12px 0;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .nav-backdrop {
        display: block;
    }

    .nav-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    section {
        padding: 60px 16px;
    }

    #hero {
        padding: calc(var(--header-h) + 40px) 16px 60px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

    .package-card {
        padding: 28px 20px;
    }

    .contact-card {
        padding: 24px 20px;
    }

    .package-price {
        font-size: 1.6rem;
    }

    .section-header {
        margin-bottom: 36px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    section {
        padding: 70px 24px;
    }

    #hero {
        padding: calc(var(--header-h) + 40px) 24px 70px;
    }
}

@media (min-width: 1024px) {
    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Scroll margin for fixed header ── */

#portfolio,
#packages,
#contact {
    scroll-margin-top: 0;
}
