:root {
    --ink: #060606;
    --gold: #c4922a;
    --gold-2: #a0522d;
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    overflow-x: clip;
    max-width: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--ink);
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    overflow-x: clip;
    max-width: 100%;
}

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

.stage {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px 48px;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #2d2d2d 100%);
}

.portal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 840px;
    border-radius: 22px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    padding: 1.4rem 1.6rem 2.4rem;
}

.portal-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 0.2rem;
}

.lang-switcher {
    display: flex;
    gap: 0.35rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #c4c4c4;
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 1px;
    padding: 0.22rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
}

.lang-btn:hover,
.lang-btn.active {
    color: #fff;
    border-color: var(--gold);
    background: rgba(196, 146, 42, 0.18);
}

.code-header {
    text-align: center;
    padding: 0.4rem 0 0.4rem;
}

.code-header h1 {
    font-weight: 300;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    letter-spacing: 3px;
    margin: 0;
    color: var(--gold);
}

.underline {
    width: 60px;
    height: 4px;
    margin: 14px auto 14px;
    border-radius: 2px;
    background: linear-gradient(45deg, var(--gold), var(--gold-2));
}

.code-role {
    font-weight: 300;
    font-size: clamp(1.36rem, 3.2vw, 1.84rem);
    letter-spacing: 3px;
    margin: 0 0 1.2rem;
    color: var(--gold);
}

.intro {
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #c4c4c4;
    max-width: 46ch;
    margin: 0 auto;
    text-align: center;
}

.intro-cta {
    margin: 0;
}

.intro-link {
    color: var(--gold);
    font-weight: 400;
    border-bottom: 1px solid rgba(196, 146, 42, 0.45);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.intro-link:hover,
.intro-link:focus-visible {
    color: #d4a535;
    border-bottom-color: var(--gold);
}

h2 {
    font-weight: 300;
    font-size: 1.15rem;
    letter-spacing: 2px;
    color: var(--gold);
    text-align: center;
    margin: 0 0 1rem;
}

.offer-section,
.projects-section,
.contact {
    margin-top: 2.4rem;
}

.offer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.offer {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.2rem 1.1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.offer:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(196, 146, 42, 0.35),
        0 12px 28px rgba(0, 0, 0, 0.45);
}

.offer h3 {
    margin: 0 0 0.45rem;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 1px;
    color: #fff;
}

.offer p {
    margin: 0;
    font-weight: 300;
    font-size: 0.88rem;
    color: #c4c4c4;
    line-height: 1.45;
}

.repo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.repo {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.85rem 1.05rem;
}

.repo-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #111;
}

.repo-body {
    min-width: 0;
    flex: 1;
}

.repo-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.repo h3 {
    margin: 0;
    font-weight: 400;
    font-size: 1.02rem;
    color: var(--gold);
}

.repo p {
    margin: 0.4rem 0 0;
    font-weight: 300;
    font-size: 0.88rem;
    color: #c4c4c4;
}

.repo-links {
    display: flex;
    gap: 8px;
}

.repo-links a {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #c4c4c4;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px 10px;
    border-radius: 999px;
}

.repo-links a:hover,
.repo-links a:focus-visible {
    color: var(--gold);
    border-color: var(--gold);
}

.repo-empty {
    text-align: center;
    font-weight: 300;
    color: #8a8f9a;
    list-style: none;
}

@media (prefers-reduced-motion: reduce) {
    .offer {
        transition: none;
    }

    .offer:hover {
        transform: none;
    }
}

.contact {
    padding-bottom: 0.25rem;
}

#contact-form {
    position: relative;
    overflow: hidden;
}

.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.portal-input {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #111;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.95rem;
}

.contact-row .portal-input {
    margin-top: 0;
}

.portal-input:focus {
    outline: 1px solid var(--gold);
    border-color: var(--gold);
}

textarea.portal-input {
    min-height: 110px;
    resize: vertical;
    display: block;
}

.contact-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.send-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(45deg, var(--gold), var(--gold-2));
    padding: 10px 22px;
    border-radius: 25px;
    transition: background 0.3s ease;
}

.send-btn:hover,
.send-btn:focus-visible {
    background: linear-gradient(45deg, #d4a535, #8b4513);
}

.send-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.send-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.hp-field {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

#contact-alerts {
    min-height: 0;
    margin-bottom: 0.6rem;
}

.portal-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 300;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-alert-success {
    color: #d8e8c8;
    border-color: rgba(196, 146, 42, 0.45);
    background: rgba(196, 146, 42, 0.08);
}

.portal-alert-warning,
.portal-alert-danger {
    color: #e8d0c8;
    border-color: rgba(160, 82, 45, 0.5);
    background: rgba(160, 82, 45, 0.12);
}

@media (max-width: 640px) {
    .stage {
        padding: 16px 10px 24px;
        min-height: 0;
    }

    .portal {
        padding: 1.1rem 1rem 1.4rem;
        border-radius: 18px;
    }

    .contact {
        margin-bottom: 0;
    }

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

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