:root {
    --bg: #090909;
    --panel: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f4f4f2;
    --muted: rgba(244, 244, 242, 0.66);
    --accent: #d9d3c5;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);

    --steel-rgb: 180, 190, 205;
    --steel-soft: rgba(var(--steel-rgb), 0.10);
    --steel-mid: rgba(var(--steel-rgb), 0.20);
    --steel-glow: rgba(var(--steel-rgb), 0.32);
    --steel-text: #e0e7ef;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 20%, rgba(255,255,255,0.06), transparent 28%),
        radial-gradient(circle at 82% 15%, rgba(255,255,255,0.04), transparent 25%),
        linear-gradient(160deg, #050505 0%, #111111 100%);
    color: var(--text);
    min-height: 100vh;
}

a { color: inherit; }

.page-shell {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 32px 0;
}

.portfolio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 370px);
    gap: 24px;
}

.viewer-card,
.info-card,
.admin-card {
    background: var(--panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.viewer-card {
    position: relative;
    padding: 22px;
    box-shadow:
        0 0 0 1px rgba(var(--steel-rgb), 0.40),
        0 0 34px rgba(var(--steel-rgb), 0.26),
        0 0 80px rgba(var(--steel-rgb), 0.14),
        0 30px 80px rgba(0, 0, 0, 0.38);
}

.carousel {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
        inset 0 0 0 1px rgba(var(--steel-rgb), 0.14),
        inset 0 0 28px rgba(var(--steel-rgb), 0.07);
}

.slides {
    position: relative;
    width: 100%;
    height: 70vh;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease;
}

.slide.is-active {
    opacity: 1;
    visibility: visible;
}

.slide-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-drag: none;
}

.slide-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.26) 100%);
    pointer-events: none;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(180, 190, 205, 0.40);
    background: rgba(10,10,10,0.44);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    box-shadow:
        0 0 22px rgba(180, 190, 205, 0.34),
        0 0 40px rgba(180, 190, 205, 0.12),
        inset 0 0 10px rgba(255,255,255,0.05);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.carousel-nav:hover {
    background: rgba(24, 28, 34, 0.72);
    box-shadow:
        0 0 28px rgba(180, 190, 205, 0.42),
        0 0 52px rgba(180, 190, 205, 0.16),
        inset 0 0 12px rgba(255,255,255,0.06);
}

.carousel-nav.prev { left: 14px; }
.carousel-nav.next { right: 14px; }

.dots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding-top: 18px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.24);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 6px rgba(180, 190, 205, 0.08);
}

.dot.is-active {
    background: var(--steel-text);
    transform: scale(1.15);
    box-shadow:
        0 0 12px rgba(180, 190, 205, 0.42),
        0 0 28px rgba(180, 190, 205, 0.18);
}

.info-card {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
}

.eyebrow, .label, .admin-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 10px;
}

h1, h2 {
    margin: 0;
    font-weight: 600;
    line-height: 1.04;
}

h1 {
    font-size: clamp(34px, 4vw, 52px);
}

h2 {
    font-size: 28px;
}

.info-card h1 {
    color: #f1f4f8;
    text-shadow:
        0 0 14px rgba(180, 190, 205, 0.24),
        0 0 34px rgba(180, 190, 205, 0.12);
}

.subtitle {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.contact-block {
    display: grid;
    gap: 6px;
}

.contact-link {
    text-decoration: none;
    font-size: 18px;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

.note,
.empty-hint,
.admin-help,
.flash,
.small-note {
    color: var(--muted);
    line-height: 1.6;
}

.legal-note {
    margin: 8px 0 14px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(244, 244, 242, 0.52);
}

.empty-state {
    min-height: 70vh;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 10px;
}

.admin-page {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 48px;
}

.admin-card {
    padding: 28px;
    margin-top: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn,
button,
input[type="submit"] {
    font: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.btn.primary {
    background: #e7e0d1;
    color: #111;
    border-color: transparent;
}

.btn.danger {
    background: rgba(165, 58, 58, 0.18);
}

form { margin: 0; }

.login-wrap {
    width: min(520px, calc(100% - 40px));
    margin: 8vh auto;
}

.field,
.upload-field {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.upload-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.gallery-admin-grid {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.admin-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
}

.admin-thumb {
    height: 130px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.08);
}

.admin-meta {
    display: grid;
    gap: 12px;
}

.inline-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.08);
}

.status-pill.off {
    background: rgba(139, 86, 86, 0.22);
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 980px) {
    .portfolio-layout {
        grid-template-columns: 1fr;
    }

    .slides,
    .carousel,
    .empty-state {
        min-height: 52vh;
        height: 52vh;
    }

    .admin-item {
        grid-template-columns: 1fr;
    }

    .admin-thumb {
        height: 220px;
    }
}

.partner-block {
    position: relative;
}

.partner-link {
    position: relative;
    display: inline-block;
    width: fit-content;
}

.partner-link::after {
    content: "Promo code: " attr(data-promocode);
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(18, 18, 18, 0.94);
    color: var(--text);
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 20;
    pointer-events: none;
}

.partner-link::before {
    content: "";
    position: absolute;
    left: 18px;
    bottom: calc(100% + 4px);
    width: 10px;
    height: 10px;
    background: rgba(18, 18, 18, 0.94);
    border-left: 1px solid rgba(255,255,255,0.12);
    border-top: 1px solid rgba(255,255,255,0.12);
    transform: rotate(225deg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 19;
    pointer-events: none;
}

.partner-link:hover::after,
.partner-link:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}