section {
    margin-left: auto;
    margin-right: auto;
}
section.add-content{
    width: max-content;
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--space-4);
    height: max-content;
}
section.add-content input,
section.add-content textarea{
    width: 450px;
}
section.add-content > form{
    margin-bottom: var(--button-size);
}
button.action {
    display: flex;
    align-items: center;
    width: max-content;
    float: right;
    background: var(--color-primary);
}
button.action > span{
    color: var(--color-primary-invert) !important;
    font-size: var(--font-size);
}
nav.action{
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: var(--space-1);
}
.action > a{
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    height : var(--button-size);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}
nav.action > a > span {
    color: var(--color-text-muted);
}
/* action-light */
nav.action-light{
    display: flex;
    flex-wrap: wrap;
}
nav.action-light > a{
    min-height: var(--button-size);
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    font-weight: 300;
    text-transform: uppercase;
    width: max-content;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}
/* about */
section#about{
    width: var(--breakpoint-xl);
}
@media screen and (min-width: 651px) {
    section#about {
        display: grid;
        grid-template-columns: calc(var(--breakpoint-xl) * 0.4) 1fr;
        margin: 0 auto;
    }
    section#about > img{
        grid-column: 2 / 3;
        grid-row: 1 / 4;
        align-self: flex-start;
    }
}
/* Общий контейнер для секции "О нас" */
section#about {
    max-width: 1200px;
}
section#about h2 {
    font-size: var(--font-size-xl);
    text-align: left;
    margin-bottom: var(--space-5);
    color: var(--color-primary-dark);
    font-weight: 400;
    padding-left: var(--space-3);
}
section#about p {
    font-size: var(--font-size-md);
    text-align: left;
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
    padding-left: var(--space-2);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}
/* Стили для #roadmap */
#roadmap {
    margin-bottom: var(--space-3);
    max-width: calc(100vw - (var(--space-3) * 2));
    counter-reset: item;
    padding-left: var(--space-4);
}
#roadmap h3 {
    font-size: var(--font-size-lg);
    text-align: center;
    margin-bottom: var(--space-4);
    color: var(--color-text);
    padding-left: var(--space-3);
}
.stage {
    position: relative;
    background-color: transparent;
    padding-left: var(--space-3);
    padding-right: var(--space-1);
    transition: box-shadow var(--transition-speed, 0.2s ease);
    margin-left: var(--space-3);
}
.stage::before{
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    counter-increment: item; content: " " counter(item);
    left: -1.5em;
    color: #000;
    font-weight: 600;
    font-size: var(--font-size-xs);
    width: 1.5em;
    height: 1.5em;
    background: var(--color-primary-dark);
    color: var(--color-primary-invert);
    border-radius: .5rem;
    z-index: 2;
}
.stage::after{
    content: "";
    position: absolute;
    top: 0;
    left: -0.75em;
    height: 100%;
    border: 2px solid var(--color-primary-dark);
}
.stage:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}
.stage h4 {
    font-size: var(--font-size);
    font-weight: 400;
    margin-bottom: var(--space-2);
    margin-top: unset;
    line-height: 1;
    margin-left: unset;
    padding-left: unset;
    padding-bottom: var(--space-1);
    color: var(--color-primary-dark);
    padding-bottom: unset;
    padding-top: 1em;
}
.stage p {
    font-size: var(--font-size) !important;
    padding-bottom: 1em;
    color: var(--color-text-muted);
    font-size: var(--font-size);
    margin-top: unset;
    font-weight: 300 !important;
    margin-bottom: unset !important;
}
/* Стили для .about-team & .about-location */
.about-location,
.about-team {
    margin-bottom: var(--space-6);
}
.about-location h3,
.about-team h3 {
    font-size: var(--font-size-lg);
    text-align: left;
    margin-left: var(--space-2);
    margin-bottom: var(--space-4);
    color: var(--color-text);
}
.about-location p,
.about-team p {
    font-size: var(--font-size-md);
    text-align: left;
    margin-bottom: 0;
    color: var(--color-text-muted);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: var(--font-size);
    font-weight: 300 !important;
}
@media screen and (max-width: 651px) {
    .stage {
        width: calc(100vw - (var(--space-5) * 2));
    }
}
/* grid advantages */
section#advantage {
    width: var(--breakpoint-lg);
    margin: var(--space-4) auto 0 auto;
}
section#advantage > div {
    height: 100%;
}
section#advantage > div >img{
    margin-top: var(--space-2);
}
section#advantage > div > h3{
    color: var(--color-text);
}
section#advantage > div > p{
    font-weight: 300;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.grid.advantages-grid {
    width: var(--breakpoint-xl);
    max-width: 100%;           /* Ensures it doesn't overflow smaller screens */
    display: grid;
    grid-template-columns: repeat(auto-fill , minmax(12rem , 1fr));
    gap: var(--space-2);
}

.grid.advantages-grid > div {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}
.grid.advantages-grid > div > img {
    width: 40px;
    opacity: 0.75;
}
.grid.advantages-grid > div > p,
.grid.advantages-grid > div > h3{
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    margin: unset;
    padding-bottom: 0.5rem;
}
.grid.advantages-grid > div > p{
    font-size: var(--font-size-xs);
}
@media screen and (max-width : 650px){
    .grid.advantages-grid > div{
        margin-left: 0.5rem;
        max-width: calc(100% - 1rem) !important;
        padding-right: unset;
        padding-left: unset;
    }
}
/* cta button */
.action{
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-2);
}
.action > a{
    color: var(--color-text);
}
.action > a,
.cta-button{
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    height: var(--button-size);
    font-size: var(--font-size-md);
    font-weight: 300;
    width: max-content;
    display: flex;
    align-items: center;
    padding-right: var(--space-3);
    padding-left: var(--space-3);
}
.cta-button{
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    transition: 0.5s;
}
.cta-button > span{
    color: var(--color-primary);
    transition: 0.5s;
    text-transform: uppercase;
    font-weight: 400;
    font-size: var(--font-size-xs);
}
.cta-button:hover{
    opacity: 1 !important;
    border: 1px solid var(--color-primary-hover);
}
.cta-button:hover > span{
    color: var(--color-primary-hover);
}
/* services */
/* Стили для секции Услуги */
#services {
    padding: var(--space-6) var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
}
.services-container h2 {
    font-size: var(--font-size-2xl);
    font-weight: 400;
    text-align: center;
    margin-bottom: var(--space-3);
    color: var(--color-primary-dark);
}
.services-container p {
    font-size: var(--font-size-md);
    text-align: center;
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.services-grid {
    max-width: var(--breakpoint-2xl);
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-5);
}
.service-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    transition: box-shadow var(--transition-speed, 0.2s ease), transform var(--transition-speed, 0.2s ease);
    padding-bottom: calc(var(--button-size) + 0.5rem);
    position: relative;
}
.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}
.service-card img{
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    width: 100%;
}
.service-card h3 {
    font-weight: 300;
    margin: unset;
    line-height: 1;
    font-size: var(--font-size-xl);
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--color-primary-dark);
}
.service-card p {
    text-align: left;
    margin-left: unset;
    padding-left: unset;
    font-size: var(--font-size);
    font-weight: 300;
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
}
.service-card h3,
.service-card p{
    padding-left: 0.5rem;
    max-width: calc(100% - 1rem);
}
.service-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-3);
}
.service-card ul li {
    padding: var(--space-1) 0;
    font-size: var(--font-size);
    color: var(--color-text);
}
.service-card ul li strong {
    color: var(--color-text-muted);
}
.service-card .cta-button{
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    align-self: center;
}
.service-card .cta-button:hover {
    background-color: var(--color-primary-hover);
}
.service-card .cta-button:hover > span{
    color: var(--color-primary-invert); 
}
/* checkbox .g-c */
.checkbox-group{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.g-c{
    display: flex;
    align-items: center;
    min-height: var(--button-size);
    position: relative;
}
.g-c > input {
    position: absolute;
    display: none;
}
.g-c > input + label::before{
    content: "";
    position: relative;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    width: var(--space-3);
    height: var(--space-3);
    margin-right: var(--space-2);
}
.g-c > input:checked + label::before{
    background: var(--color-primary);
    border: 1px solid var(--color-background);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.g-c > input + label{
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    padding-left: var(--space-2);
    margin-bottom: unset;
    border-radius: var(--radius-sm);
    padding-right: var(--space-3);
    min-height: var(--button-size);
    border: 1px solid var(--color-border);
}
.g-c > input:checked + label{
    border-color: var(--color-primary);
}
#calculator-result + span{
    display: flex;
    text-align: center;
    color: var(--color-text-muted);
    font-weight: 300;
    padding-top: var(--space-3);
}
/* default generation */
.btn.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-primary-invert);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: var(--space-4);
}
.btn.btn-primary:hover {
    background-color: var(--color-primary-hover);
}
/* Contact generated */
.contact-section {
    padding: var(--space-7) 0;
    font-family: 'roboto', sans-serif;
}
section#contact .container {
    max-width: var(--breakpoint-lg);
}
.section-title {
    font-size: var(--font-size-2xl);
    color: var(--color-primary);
    text-align: center;
    margin-bottom: var(--space-3);
    font-family: 'roboto_slab', serif;
}
.section-subtitle {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-6);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-7);
    background-color: var(--color-surface);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: var(--space-7);
}
/* Стили для блока с информацией */
.contact-info h3, .contact-form h3 {
    font-size: var(--font-size-xl);
    color: var(--color-text);
    margin-bottom: var(--space-5);
    font-family: 'roboto_condensed', sans-serif;
}
.contact-info p {
    color: var(--color-text-muted);
    line-height: 1.6;
}
.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    font-size: var(--font-size);
    color: var(--color-text);
}
.contact-icon {
    width: 24px;
    height: 24px;
    margin-right: var(--space-4);
    filter: invert(70%) sepia(50%) saturate(500%) hue-rotate(330deg); 
}
.contact-item a {
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.3s;
}
.contact-item a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}
.social-links {
    margin-top: var(--space-5);
}
.social-links a {
    margin-right: var(--space-4);
    display: inline-block;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.social-links a:hover {
    opacity: 1;
}
.social-links img {
    width: 32px;
    height: 32px;
}

/* Стили для формы */
.contact-form .form-group {
    margin-bottom: var(--space-4);
}
.contact-form label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--color-text);
    font-weight: 500;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: var(--space-3);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size);
    box-sizing: border-box;
}
.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}
.privacy-policy-agreement {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-4);
    text-align: center;
}
.privacy-policy-agreement a {
    color: var(--color-text-muted);
    text-decoration: underline;
}

/* Стили для карты */
.map-container {
    height: 450px;
    width: 100%;
    border: 1px solid var(--color-border);
    filter: grayscale(1) invert(1); /* стилизация под темную тему */
}
@media screen and (min-width : 751px){
    section#contact .container {
        margin: 0 auto;
        padding: 0 var(--space-4);
    }
    .contact-wrapper {
        border-radius: var(--radius-lg);
    }
    .contact-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    .contact-form button.btn{
        width: max-content;
        float: right;
    }
    .map-container {
        border-radius: var(--radius-lg);
    }
}
/* Other section */
section#other {
    width: var(--breakpoint-lg);
}
section#other > nav {
    flex-direction: column;
}
/* grid-tile */
section#hero > .content > article > img.tag{
    width: 3em;
    aspect-ratio: 1/1;
}
section#about{
    display: grid;
}
section#about > h2{
    grid-column: 1 / 2;
}
section#about > .grid-tile{
    grid-column: 1 / -1;
}
.grid-tile{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill , minmax(250px , 1fr));
    gap: var(--space-2);
}
.grid-tile > div{
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.grid-tile > div > img{
    width: 4em;
    aspect-ratio: 1/1;
}
.grid-tile > div > h3 + p{
    font-size: var(--font-size);
}
/* small grid-tile */
@media screen and (max-width : 651px){
    .small.grid-tile{
        grid-template-columns: 1fr 1fr;
    }
    .small.grid-tile > div {
        height: 100%;
    }
    section#advantage > div > p,
    .small.grid-tile > div > p{
        font-size: var(--font-size-xs) !important;
        color: var(--color-text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
/* product grid */
section#catalogue {
    width:var(--breakpoint-lg);
}
section#catalogue > h2{
    width: var(--breakpoint-sm);
    margin: 0 auto;
    line-height:1;
}
section#catalogue > h2,
section#catalogue > h2 + p{
    margin-top: var(--space-4);
    padding-bottom: var(--space-5);
}
section#catalogue > h2 + p{
    width: var(--breakpoint-lg);
    margin: 0 auto;
}
section#catalogue > h2 { 
    font-family:roboto_slab , sans-serif;
    font-size:var(--font-size-2xl);
    color: var(--color-primary);
    text-align: center;
}
section#catalogue > h2 + p{
    color: var(--color-text-muted);
}
.product-grid {display: grid;grid-template-columns: repeat(auto-fill,minmax(250px , 1fr));}
.product-grid > div {background: var(--color-surface);border: 1px solid var(--color-border);padding-bottom: calc(var(--button-size) + 1rem);position: relative;}
.product-grid > div > h3 , .product-grid > div > .action {margin-left: var(--space-2);margin-right: var(--space-2); line-height: 1.1;color: var(--color-text);}
.product-grid{gap:var(--space-2)}
.product-grid > div > img {width :100% ;aspect-ratio: 3/4; object-fit: cover;}
.product-grid.square > div > img{aspect-ratio: 1/1; object-fit: contain;}
.product-grid > div a.cta-button{position: absolute; bottom: 0.5rem;left: 0.5rem;}
.product-grid > div a:hover{
    color: var(--color-primary);
    border-color: var(--color-primary);
    cursor: pointer;
}
@media screen and (min-width : 651px) {
    .product-grid > div > img {
        border-top-left-radius: var(--radius-lg);
        border-top-right-radius: var(--radius-lg);
    }
    .product-grid > div {border-radius: var(--radius-lg);}
}
@media screen and (max-width : 650px){
    section#catalogue > h2,
    section#catalogue > h2 + p{
        margin-left: var(--space-2);
        width: calc(100% - var(--space-4));
    }
}
/* large product grid */
section#catalogue:has(.large) {
    width:var(--breakpoint-2xl);
}
.large.product-grid {display: grid;grid-template-columns: repeat(auto-fill,minmax(350px , 1fr));}
.large.product-grid > div > img {aspect-ratio: 4/3;object-fit: cover; width: 100%;}

/* small product grid */
@media screen and (max-width : 650px) {
    .small.product-grid{
        grid-template-columns: 1fr 1fr;
    }
    .small.product-grid > div > h3 {
        font-weight: 400;
        font-size: var(--font-size);
    }
    .small.product-grid > div a{
        justify-content: center;
    }
}

/* main nav */
main > nav.action-light{
    flex-direction: column;
    flex-wrap: nowrap;
}
/* main centered */
main.centered{
    width: var(--breakpoint-sm);
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--space-8);
}
/* image centered */
#about > img:nth-child(2){
    object-fit: contain;
    height: 100%;
}
/* about and cta */
section#about > h2{
    grid-column: 1 / -1;
    margin: var(--space-4) 0 var(--space-2) 0 ;
    padding-left: unset;
}
section#about > p + p {color:var(--color-text)}
section#about > .service-categories {
    width: var(--breakpoint-md);
    margin: 0 auto;
    grid-column: 1 /-1;
}
section#about > .service-categories > h3 {
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    font-family: roboto_slab , sans-serif;
    text-align: center;
}
section#about > .service-categories > h3 + ul{
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-3);
}
section#about > .service-categories > h3 + ul > li{
    display: flex;
    align-items: center;
    font-weight: 300;
    color: var(--color-text);
    min-height: var(--button-size);
    margin-top: var(--space-2);
}
@media screen and (max-width:650px){
    section#about > h2{
        padding-left: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}
main > div.catalogue-cta{
    width: var(--breakpoint-sm);
    margin: var(--space-7) auto 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
}
main > div.catalogue-cta > h4{
    font-size: var(--font-size-lg);
    font-family: roboto_slab , sans-serif;
}
main > div.catalogue-cta > button{
    margin-left: auto;
    width: max-content;
    justify-content: flex-end;
    margin-right: var(--space-2);
    margin-bottom: var(--space-2);
}
@media screen and (min-width : 651px) {
    main > div.catalogue-cta{
        border-radius: var(--radius-md);
    }
}
@media screen and (max-width : 650px) {
    .service-categories ul{
        margin-left: var(--space-3);
        width: calc(100% - var(--space-5));
    }
}
section > h2,
section > p{
    margin-top: unset;
    margin-bottom: unset;
    padding-bottom: unset;
    padding-top: unset;
    color: var(--color-text);
}
section .gallery-grid{
    margin-top: var(--space-4);
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(3 , 1fr);
}
@media screen and (max-width : 650px){
    section .gallery-grid{
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }
    section .gallery-grid > div{
        min-width: 71vw;
        scroll-snap-align: start;
    }
}
/* portfolio */
section#portfolio{
    width: var(--breakpoint-lg);
    margin: 0 auto;
}
section#portfolio > h2 {
    font-size: var(--font-size-xl);
    padding-bottom: unset;
    margin-bottom: unset;
}
section#portfolio > h2 + p{
    color: var(--color-text-muted);
    padding-top: unset;
    margin-top: unset;
}
section#portfolio .video-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill , minmax(450px , 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}
section#portfolio .video-grid,
section#portfolio .image-grid{
    margin-bottom: var(--space-3);
}
.grid-image,
section#portfolio .image-grid{
    display: grid;
    grid-template-columns: repeat(3 , 1fr);
    gap: var(--space-2);
}
.grid-image img,
section#portfolio .image-grid img{
    aspect-ratio: 1/1;
    width: 100%;
    object-fit: cover;
}
section#portfolio .video-grid video{
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
    max-width: 100vw;
    height: 100%;
}
@media screen and (min-width : 651px){
    section#portfolio .video-grid video{
        border-radius: var(--radius-md);
    }
}
/* Stories Section Styling */
#stories {
    padding: 40px 0;
    width: 100%;
    max-width: var(--breakpoint-lg);
}

#stories h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 2em;
}

.stories-container {
    display: flex;
    gap: 20px;
    padding: 10px 25px 20px 25px;
    overflow-x: auto;
    /* For smooth scrolling on touch devices */
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for a cleaner look */
    scrollbar-width: none; /* Firefox */
}

.story-preview {
    flex: 0 0 90px; /* Prevents shrinking, sets base width */
    width: 90px;
    min-height: max-content;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    text-align: center;
    position: relative;
    transform: scale(0.9);
}

.story-preview:hover {
    transform: scale(1);
}

.story-preview img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff; /* White inner border */
}

.story-preview span {
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: -22px;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--color-text-muted);
    width: 100px;
}

/* Story Viewer (Modal) Styling */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-viewer.active {
    display: flex;
    opacity: 1;
}

.story-viewer video {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* On mobile, make video fit the width */
@media (max-width: 768px) {
    .story-viewer video {
        width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: 0;
    }
}

.close-story {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 10001;
}

.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: background-color 0.2s;
}
.story-nav:hover {
    background: rgba(0,0,0,0.6);
}

.story-nav.prev {
    left: 15px;
}
.story-nav.next {
    right: 15px;
}

.story-progress-bar {
    position: absolute;
    top: 10px;
    width: 95%;
    max-width: 600px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    z-index: 10001;
}
.story-progress-bar .progress {
    width: 0%;
    height: 100%;
    background-color: white;
    transition: width 0.1s linear;
}