/* ==========================================================================
   ИМА ЛЮБОВ – Business Magazine
   Design reference: Figma "Сайтове" › Home (1920 × 4515)
   ========================================================================== */

:root {
    /* Colors */
    --c-black: #000;
    --c-white: #fff;
    --c-text: #fcfcfc;
    --c-muted: #8c8a8a;
    --c-placeholder: #a2a2a2;
    --c-gold-1: #c3972c;
    --c-gold-2: #f4eb86;
    --c-gold-badge-1: #ca8f2c;
    --c-gold-badge-2: #dac05c;
    --c-gold-line: #e2cd66;
    --c-input-bg: rgba(255, 255, 255, .13);
    --c-outline: rgba(255, 255, 255, .3);

    --g-gold: linear-gradient(90deg, var(--c-gold-1) 0%, var(--c-gold-2) 100%);

    /* Fonts */
    --f-serif: "Playfair Display", "Times New Roman", serif;
    --f-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --f-badge: "Rubik", var(--f-sans);

    /* Layout */
    --container: 1296px;
    --gutter: 16px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--c-black);
}
body {
    margin: 0;
    background: var(--c-black);
    color: var(--c-white);
    font-family: var(--f-sans);
    font-size: 14px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Figma renders standard Cyrillic glyphs – disable Manrope's Bulgarian localized forms */
    font-feature-settings: "locl" 0;
    overflow-x: hidden;
}
button, input, .swal2-popup { font-feature-settings: "locl" 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
button, input { font: inherit; color: inherit; }
strong { font-weight: 600; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* Elements revealed by the intro timeline */
.js [data-intro] { visibility: hidden; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; top: 12px; left: 12px; z-index: 100;
    padding: 8px 14px;
    background: var(--c-white); color: var(--c-black);
    transform: translateY(-200%);
    transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: none; }
:focus-visible { outline: 1px solid var(--c-gold-line); outline-offset: 3px; }

.container {
    width: min(var(--container), 100% - var(--gutter) * 2);
    margin-inline: auto;
}

/* ==========================================================================
   HERO – .hero__top (header + magazine) always fits the viewport
   ========================================================================== */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: clip;
    background: var(--c-black);
}

.hero__top {
    position: relative;
    flex: none;
    height: 100vh;
    height: 100svh;
    min-height: 520px;              /* really short screens scroll instead */
    container-type: size;
}

/*
 * --u is "one Figma pixel" for everything around the magazine. It shrinks
 * the whole composition so that the magazine always fits the viewport.
 * 785 = magazine height, 875 = needed width.
 */
.hero__canvas {
    --mag-top: clamp(96px, 9.3svh, 135px);
    --mag-bottom: clamp(24px, 5svh, 72px);   /* breathing room above the window edge */
    --u: min((100cqh - var(--mag-top) - var(--mag-bottom)) / 785, (100cqw - 24px) / 875, 1.3px);
    /* centred in the free space when the composition is width-limited (phones) */
    --stage-top: calc(var(--mag-top) + (100cqh - var(--mag-top) - var(--mag-bottom) - 785 * var(--u)) / 2);
    position: absolute;
    inset: 0;
}

.hero__texture {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: calc(var(--stage-top) + 720 * var(--u));
    overflow: hidden;
    background: var(--c-black);
}
.hero__texture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 100%;
    opacity: .41;
}

.stage {
    position: absolute;
    top: var(--stage-top);
    left: calc(50% - 426 * var(--u));     /* magazine centre sits 11.5px right of page centre */
    width: calc(875 * var(--u));
    height: calc(785 * var(--u));
}

.stage__title {
    position: absolute;
    left: calc(425.64 * var(--u));
    top: calc(145 * var(--u));
    translate: -50% 0;
    font-family: var(--f-serif);
    font-size: calc(226.744 * var(--u));
    line-height: calc(195 * var(--u));
    text-align: center;
    white-space: nowrap;
    color: rgba(255, 255, 255, .06);
    pointer-events: none;
    user-select: none;
}

/* Gold issue badge */
.badge {
    position: absolute;
    left: calc(145 * var(--u));
    top: calc(135 * var(--u));
    width: calc(121 * var(--u));
    height: calc(121 * var(--u));
    z-index: 1;
}
.badge__inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--c-gold-badge-1) 0%, var(--c-gold-badge-2) 100%);
    font-family: var(--f-badge);
    color: var(--c-white);
    line-height: 1.185;
    white-space: nowrap;
}
.badge__inner > * { position: absolute; left: calc(18 * var(--u)); }
.badge__issue   { top: calc(24 * var(--u)); font-size: calc(17.778 * var(--u)); font-weight: 600; }
.badge__date    { top: calc(44 * var(--u)); font-size: calc(13 * var(--u)); font-weight: 500; text-transform: uppercase; }
.badge__line    { top: calc(65 * var(--u)); left: calc(19 * var(--u)); width: calc(80 * var(--u)); height: max(1px, var(--u)); background: var(--c-white); }
.badge__edition { top: calc(70 * var(--u)); font-size: calc(13 * var(--u)); font-weight: 300; }

/* Magazine (3D flip card) */
.mag {
    position: absolute;
    inset: 0;
    z-index: 2;
}
.mag__float,
.mag__tilt,
.mag__card { position: absolute; inset: 0; }
.mag__float { perspective: 1800px; }
.mag__tilt,
.mag__card { transform-style: preserve-3d; }
.mag__card { will-change: transform; }

.mag__face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.mag__face--front img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 calc(30 * var(--u)) calc(40 * var(--u)) rgba(0, 0, 0, .55));
}
/* Back cover – same silhouette as the cover (mirrored), dark with a centred label */
.mag__face--back {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(180deg);
    clip-path: polygon(59.14% .1%, .2% 10.57%, 41% 99.8%, 99.9% 85.27%);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .08) 48%, rgba(255, 255, 255, 0) 62%),
        radial-gradient(ellipse at 50% 45%, #2a2a2a 0%, #141414 55%, #070707 100%);
}
/* Centred on the silhouette and tilted with the page */
.mag__back-label {
    transform: translate(.1%, -1.1%) rotate(-10.7deg);
    font-family: var(--f-serif);
    font-style: italic;
    font-size: calc(128 * var(--u));
    line-height: 1;
    color: var(--c-white);
}
/* Light sweep that is clipped to the cover silhouette */
.mag__shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .28) 50%, rgba(255, 255, 255, 0) 60%) no-repeat;
    background-size: 250% 100%;
    background-position: 160% 0;
    -webkit-mask: url("assets/img/magazine-cover.webp") center / 100% 100% no-repeat;
    mask: url("assets/img/magazine-cover.webp") center / 100% 100% no-repeat;
    mix-blend-mode: soft-light;
}

/* ---------- Header ---------- */
.site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    padding-top: clamp(20px, 3.03svh, 44px);   /* Figma: buttons at y 44 */
}
.site-header__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.logo {
    display: block;
    margin-left: -2px;
    width: 130px;
}
.logo img { width: 100%; height: auto; }
.nav {
    display: flex;
    gap: 21px;
    margin-right: -2px;         /* Figma: buttons span x 1298 → 1610 */
}
.nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 124px;
    height: 47px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: 14px;
    line-height: 1.8;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
    transition: color .4s var(--ease), border-color .4s var(--ease);
}
.nav__link--old { min-width: 167px; padding: 0 14px; }   /* Figma: 124px / 167px wide boxes */
.nav__link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--c-white);
    transform: translateY(101%);
    transition: transform .45s var(--ease);
}
.nav__link:hover,
.nav__link:focus-visible { color: var(--c-black); border-color: var(--c-white); }
.nav__link:hover::before,
.nav__link:focus-visible::before { transform: none; }

/* ---------- Subscribe ---------- */
.subscribe {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 79px;
    padding-inline: var(--gutter);
    text-align: center;
}
.subscribe__title {
    width: 580px;
    max-width: 100%;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: clamp(36px, 9.6vw, 64px);
    line-height: 1.09;
    background: var(--g-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    padding-bottom: .06em;            /* keeps italic descenders inside the clip */
    margin-bottom: -.06em;
}
.subscribe__text {
    width: 569px;
    max-width: 100%;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.8;
}
.subscribe__form {
    position: relative;
    display: flex;
    width: 651px;
    max-width: 100%;
    height: 47px;
    margin-top: 47px;
    border: 1px solid var(--c-white);
    background: var(--c-input-bg);
}
.subscribe__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 20px;
    border: 0;
    background: transparent;
    font-size: 14px;
    line-height: 1.8;
    color: var(--c-white);
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
.subscribe__input::placeholder { color: var(--c-placeholder); opacity: 1; }
.subscribe__input:focus { outline: none; }
.subscribe__form:focus-within { box-shadow: 0 0 0 1px var(--c-gold-line); border-color: var(--c-gold-line); }
.subscribe__btn {
    position: relative;
    flex: 0 0 135px;
    height: 45px;
    padding: 0 25px;
    border: 0;
    background: var(--c-white);
    color: var(--c-black);
    font-weight: 300;
    font-size: 14px;
    line-height: normal;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    border-radius: 0;
}
.subscribe__btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--g-gold);
    transform: translateY(101%);
    transition: transform .45s var(--ease);
}
.subscribe__btn:hover::before,
.subscribe__btn:focus-visible::before { transform: none; }
.subscribe__btn[disabled] { cursor: progress; }
.subscribe__status { margin-top: 12px; color: var(--c-gold-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 47px;
    margin-top: 39px;
    padding: 0 26px 0 40px;
    border: 1px solid var(--c-outline);
    font-size: 16px;
    line-height: 1.8;
    text-transform: uppercase;
    color: var(--c-white);
    transition: border-color .35s var(--ease), color .35s var(--ease);
}
.btn-outline svg { flex: none; transition: transform .35s var(--ease); }
.btn-outline:hover { border-color: var(--c-gold-line); color: var(--c-gold-2); }
.btn-outline:hover svg { transform: translateX(4px); }

.gold-line {
    display: block;
    width: 1028px;
    max-width: 100%;
    height: 2px;
    margin-top: 60px;
    background: linear-gradient(90deg, #010101 0%, var(--c-gold-line) 50.48%, #010101 100%);
}

/* ==========================================================================
   STORIES – pinned image, scrolling text
   ========================================================================== */
.story {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background: var(--c-black);
}
/* Pinned layout – enabled by app.js */
.has-pin .story {
    height: 100vh;
    height: 100svh;
    min-height: 560px;
}
.story--one { margin-top: 66px; }

.story__media {
    position: absolute;
    top: 0;
    height: 100%;
}
.story__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}
/* Figma: 1972px wide image, aligned left */
.story--one .story__media { left: 0; width: 102.71%; }
.story--one .story__media img { object-position: 50% 28%; transform-origin: 75% 35%; }
/* Figma: 2256px wide image starting at -220px */
.story--two .story__media { left: -11.46%; width: 117.5%; }
.story--two .story__media img { object-position: 50% 22%; transform-origin: 25% 30%; }

.story__shade { position: absolute; inset: 0; pointer-events: none; }
.story--one .story__shade {
    background:
        linear-gradient(180deg, #000 0, #000 20px, rgba(0, 0, 0, 0) 147px),
        linear-gradient(90deg, #000 0%, #000 46.46%, rgba(0, 0, 0, 0) 72.66%);
}
.story--two .story__shade {
    background:
        linear-gradient(0deg, #000 0, rgba(0, 0, 0, 0) 200px),
        linear-gradient(270deg, #000 0%, #000 51.03%, rgba(0, 0, 0, 0) 79.38%);
}

.story__viewport {
    position: relative;
    z-index: 1;
    height: 100%;
}
.has-pin .story__viewport {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 70px, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 70px, #000 100%);
}
.story__content {
    display: block;
    padding-bottom: 170px;
    will-change: transform;
}
.story--one .story__content { width: 888px; max-width: 100%; padding-top: 78px; }
.story--two .story__content { width: 65.355%; margin-left: 34.645%; padding-top: 120px; }

.story__title {
    font-family: var(--f-serif);
    line-height: 1.333;
    color: var(--c-white);
}
.story--one .story__title { max-width: 793px; font-size: 32px; }
.story--two .story__title { max-width: 623px; font-size: 36px; }

/* Body copy is slightly bigger than in Figma (14px) because it scrolls */
.story__body {
    font-size: 17px;
    line-height: 1.6;
    color: var(--c-white);
}
.story--one .story__body { margin-top: 54px; }
.story--two .story__body { margin-top: 64px; }
.story__body p + p { margin-top: 1.6em; }

.story__sign { margin-top: 36px; }
.story--two .story__sign { margin-top: 48px; }
.story__author {
    font-family: var(--f-serif);
    font-size: 32px;
    line-height: 1.333;
}
.story__role {
    font-weight: 300;
    font-size: 20px;
    line-height: 1.366;
    color: var(--c-muted);
}
.story--one .story__role { margin-top: 5px; }

/* ---------- Footer ---------- */
.site-footer {
    display: flex;
    justify-content: center;
    padding: 103px var(--gutter) 47px;
    background: var(--c-black);
}
.site-footer__brand { display: flex; align-items: center; }
.site-footer__logo { width: 70px; }
.site-footer__logo img { width: 100%; height: auto; }
/* Developer credit, separated from the logo by a thin white line */
.site-footer__dev {
    display: flex;
    align-items: center;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, .6);
    opacity: .8;
    transition: opacity .3s;
}
.site-footer__dev:hover, .site-footer__dev:focus-visible { opacity: 1; }
.site-footer__dev img { width: auto; height: 26px; }

/* ==========================================================================
   SweetAlert2 theme
   ========================================================================== */
.swal2-container.swal-ima-backdrop { background: rgba(0, 0, 0, .78) !important; backdrop-filter: blur(6px); }
.swal-ima.swal2-popup {
    width: min(440px, 100% - 32px);
    padding: 40px 32px 36px;
    border: 1px solid rgba(226, 205, 102, .35);
    border-radius: 0;
    background: #0b0b0b url("assets/img/bg-texture.webp") center / cover;
    background-blend-mode: multiply;
    color: var(--c-white);
    font-family: var(--f-sans);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.swal-ima .swal2-title {
    padding: 0;
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 34px;
    line-height: 1.15;
    background: var(--g-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.swal-ima .swal2-html-container {
    margin: 14px 0 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #d8d8d8;
}
.swal-ima .swal2-actions { margin-top: 28px; }
.swal-ima .swal2-confirm {
    margin: 0;
    min-width: 150px;
    height: 45px;
    padding: 0 28px;
    border-radius: 0;
    background: var(--g-gold) !important;
    color: var(--c-black) !important;
    font-family: var(--f-sans);
    font-size: 14px;
    font-weight: 400;
    box-shadow: none !important;
}
.swal-ima .swal2-loader { border-color: var(--c-gold-line) transparent var(--c-gold-line) transparent; }
.swal-ima .swal2-icon { margin: 0 auto 22px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .story--two .story__content { width: 72%; margin-left: 28%; }
}

@media (max-width: 900px) {
    .story__shade,
    .story--one .story__shade,
    .story--two .story__shade {
        background:
            linear-gradient(180deg, #000 0, rgba(0, 0, 0, .55) 160px, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .9) 100%);
    }
    .story--one .story__media,
    .story--two .story__media { left: 0; width: 100%; }
    .story--one .story__media img { object-position: 82% 20%; }
    .story--two .story__media img { object-position: 22% 20%; }
    .story--one .story__content,
    .story--two .story__content { width: 100%; margin-left: 0; padding-top: 72px; }
    .story--one .story__title { font-size: 28px; }
    .story--two .story__title { font-size: 30px; }
    .story__body { font-size: 16px; }
    .story--one .story__body,
    .story--two .story__body { margin-top: 36px; }
    .story__author { font-size: 28px; }
    .story__role { font-size: 18px; }
}

/* Mobile: natural-height hero, stacked (unpinned) stories */
@media (max-width: 767px) {
    .hero__top {
        --um: min((100vw - 24px) / 875, 1.3px);
        height: calc(104px + 785 * var(--um) + 28px);
        min-height: 0;
        container-type: normal;
    }
    .hero__canvas {
        --mag-top: 104px;
        --u: var(--um);
        --stage-top: var(--mag-top);
    }
    .subscribe { padding-top: 40px; }

    .story,
    .has-pin .story { height: auto; min-height: 0; overflow: visible; }
    .story--one { margin-top: 56px; }
    .story + .story { margin-top: 24px; }
    .story__shade,
    .story--one .story__shade,
    .story--two .story__shade { display: none; }

    .story__media,
    .story--one .story__media,
    .story--two .story__media {
        position: relative;
        left: 0;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
        overflow: hidden;
    }
    /* dark, blurred fade into the heading */
    .story__media::after {
        content: "";
        position: absolute;
        left: 0; right: 0; bottom: 0;
        height: 55%;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .65) 55%, #000 100%);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
        mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
        pointer-events: none;
    }
    .story--one .story__media img { object-position: 80% 30%; }
    .story--two .story__media img { object-position: 20% 30%; }

    .story__viewport { height: auto; margin-top: -96px; }
    .story--one .story__content,
    .story--two .story__content { padding-top: 0; padding-bottom: 64px; }
}

@media (max-width: 600px) {
    .logo { width: 96px; }
    .nav { gap: 8px; margin-right: 0; }
    .nav__link,
    .nav__link--old { min-width: 0; height: 36px; padding: 0 10px; font-size: 12px; }
    .subscribe__text { font-size: 13px; line-height: 1.7; }
    .subscribe__btn { flex-basis: 118px; padding: 0 14px; }
    .subscribe__input { padding: 0 14px; }
    .btn-outline { font-size: 14px; padding: 0 20px 0 28px; }
    .story__title { line-height: 1.25; }
    .story--one .story__title { font-size: 25px; }
    .story--two .story__title { font-size: 26px; }
    .story__body { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
