/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-light-top: #EEE7D9;
    --bg-light-bottom: #DAD3C5;
    --bg-dark-top: #B5AB9D;
    --bg-dark-bottom: #B5AB9D;
    --button-color: #615542;
    --floating-color: #7F6F56;
    --text-dark: #121212;
    --text-light: #FFFFFF;
    --footer-text: #7F6F56;
    --button-color-light: #7a6a52;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rubik', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
    font-weight: normal;
}

h1 {
    font-weight: 700;
}

h2, h3 {
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(238, 231, 217, 0.98), rgba(238, 231, 217, 0.9));
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.header-logo {
    width: 64px;
    height: 64px;
    border-radius: 999px;
}

/* Floating Accent Elements */
.floating-accent {
    position: absolute;
    width: 120px;
    height: 120px;
    background: none;
    opacity: 1;
    pointer-events: none;
    z-index: 20;
    will-change: transform;
}

.floating-1 {
    top: -2%;
    right: 5%;
    background-image: url('images/Offline_floating1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 286px;
    height: 286px;
    opacity: 1;
}

.floating-2 {
    top: 20%;
    left: 4%;
    background-image: url('images/Offline_floating2.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 264px;
    height: 264px;
    opacity: 1;
}

.floating-3 {
    top: 15%;
    right: 4%;
    background-image: url('images/Offline_floating3.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 220px;
    height: 220px;
    opacity: 1;
}

.floating-4 {
    bottom: 10%;
    right: 4%;
    background-image: url('images/Offline_floating4.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 260px;
    height: 260px;
    opacity: 1;
}

/* Animation for floating elements */
@keyframes float-rotate-1 {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(1.5deg);
    }
}

@keyframes float-rotate-2 {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(-1.2deg);
    }
}

@keyframes float-rotate-3 {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-25px) rotate(1.8deg);
    }
}

@keyframes float-rotate-4 {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-18px) rotate(-1.5deg);
    }
}

/* Note: floating elements are now rotated via scroll-based JavaScript, */
/* so the continuous CSS animations are disabled for a calmer effect. */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .floating-accent {
        animation: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 70vh;
    background: linear-gradient(to bottom, var(--bg-light-top), var(--bg-light-bottom));
    padding: 4rem 0 3rem;
}

.hero-title {
    font-size: clamp(2.6rem, 4.5vw, 4rem);
    line-height: 1.2;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: 400;
}

.title-line {
    display: block;
}

.hero-text {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 2rem;
    max-width: 420px;
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
}

.hero-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.hero-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.hero-small {
    font-size: 0.9rem;
    opacity: 0.7;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: center;
}

.hero-copy {
    max-width: 480px;
}

.hero-media {
    position: relative;
    justify-self: center;
}

.hero-photo-frame {
    overflow: hidden;
}

.hero-photo {
    width: 374px;
    height: auto;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--button-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 500;
    transition: background-color 0.25s ease;
    font-family: 'Rubik', sans-serif;
}

.btn:hover {
    background-color: var(--button-color-light);
}

.btn-secondary {
    background-color: var(--button-color);
    border: none;
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--button-color-light);
}

/* Experience Section */
.experience {
    position: relative;
    background: #FFFFFF;
    color: var(--text-dark);
    padding: 5rem 0 6rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.3;
    text-align: center;
    margin-bottom: 4rem;
}

.section-title-left {
    text-align: left;
    margin-bottom: 3rem;
}

.experience-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 50px;
    align-items: center;
}

.experience-heading {
    font-size: 1.82em; /* ~30% larger than previous (1.4em * 1.3) */
    margin-bottom: 3rem;
}

.experience-heading-strong {
    font-weight: 700;
}

.experience-image-wrap {
    position: relative;
    justify-self: flex-start;
}

.experience-image {
    border-radius: 0;
    width: 90%; /* about 20% smaller than before and less dominant */
    max-width: none;
    height: auto;
}

.experience-content {
    max-width: 420px;
    margin-left: 50px; /* pull text about 50px closer to the image */
}

.experience-steps {
    list-style: none;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.step {
    border-top: 1px solid rgba(18, 18, 18, 0.2);
    padding-top: 1.25rem;
}

.step-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.step-number {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Rubik', sans-serif;
    color: var(--text-dark);
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Rubik', sans-serif;
}

.step-text {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
}

/* Formats Section */
.formats {
    position: relative;
    background: url('images/Offline_nebo.png') center/cover no-repeat;
    padding: 6rem 0 5rem;
}

.formats-inner {
    text-align: center;
}

.formats-title {
    color: var(--text-light);
}

.formats-subline {
    font-family: 'Rubik', sans-serif;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    margin-top: 3.5rem;
}

.format-card {
    text-align: left;
    padding: 1.75rem 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    margin-bottom: 40px;
}

.format-icon {
    height: 32px;        /* 50% smaller than previous size for all symbols */
    width: auto;         /* keep natural aspect ratio */
}

/* Make icons in the first and second cards ~20% smaller than the base size */
.formats-grid .format-card:nth-child(1) .format-icon,
.formats-grid .format-card:nth-child(2) .format-icon {
    height: 26px;
}

/* Nudge the text in the first and second cards down a bit so it aligns
   visually with the text in the third (right) card */
.formats-grid .format-card:nth-child(1) .format-title,
.formats-grid .format-card:nth-child(2) .format-title {
    margin-top: 0.25rem;
}

.format-header {
    display: flex;
    flex-direction: column;      /* place symbol above the text */
    align-items: flex-start;     /* align symbol with the left edge of the text */
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.format-title {
    font-size: 1rem; /* reduced further so it's around 20% smaller than the previous size */
    margin-bottom: 0.75rem;
    font-weight: 500; /* slightly more weighty */
    font-family: 'Rubik', sans-serif;
    white-space: nowrap; /* keep each title on a single line */
}

.format-text {
    font-size: 1.125rem; /* 2px larger than previous 1rem (16px -> 18px) */
    line-height: 1.6;
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
}

/* About Section */
.about {
    position: relative;
    background: linear-gradient(to bottom, var(--bg-dark-top), var(--bg-dark-bottom));
    color: var(--text-light);
    padding: 6rem 0;
}

.about-inner {
    position: relative;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.about-image {
    text-align: center;
}

.about-image img {
    border-radius: 8px;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.about-name {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.95;
}

.about-symbol {
    position: absolute;
    right: 2rem;
    bottom: -4rem;
    width: 180px;
    opacity: 0.5;
}

/* Material Section */
.material {
    position: relative;
    background: linear-gradient(to bottom, var(--bg-light-top), var(--bg-light-bottom));
    padding: 5rem 0 3rem;
}

.material-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.material-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 0;
    padding-bottom: 0;
    line-height: 0;
    margin-top: 60px;
}

.material-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    padding: 0;
}

/* Lift steps 1 and 3 slightly upwards */
.material-step:nth-child(1),
.material-step:nth-child(3) {
    margin-top: -80px;
}

.process-number {
    font-size: 1.35rem;
    font-weight: 400;
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
    color: var(--button-color);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Fix number 2 position - it needs more space because image 2 is larger */
.material-step:nth-child(2) .process-number {
    margin-bottom: 0.75rem;
}

.material-step img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    transform-origin: top center;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

.material-copy {
    text-align: left;
    margin-top: -60px;
    margin-bottom: 0;
    padding-top: 0;
}

.material-title {
    /* About 30% smaller than previous size, then 10% smaller */
    font-size: clamp(1.26rem, 2.52vw, 2.205rem);
    font-family: 'Rubik', sans-serif;
    font-weight: 400; /* normal weight */
    margin-top: 0;
    margin-bottom: 0.85rem;
    padding-top: 0;
}

.material-new-badge {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-left: -5px;
    margin-right: 1.5rem;
    vertical-align: middle;
    transform: translateY(-2px);
}

.material-text {
    /* About 30% larger than previous size, then 10% smaller */
    font-size: clamp(1.053rem, 1.755vw, 1.233rem);
    line-height: 1.8;
    font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Georgia', serif;
    font-weight: 400;
    margin-bottom: 40px;
}

/* Variant for Punch Needle section (white background) */
.material-punch {
    background: #FFFFFF;
}

/* Slightly shrink the middle image in Punch Needle section */
.material-punch .material-step:nth-child(2) img {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

/* Lift the middle Punch Needle image slightly upwards */
.material-punch .material-step:nth-child(2) {
    margin-top: -20px;
}

/* Gallery Section */
.gallery {
    position: relative;
    background: linear-gradient(to bottom, var(--bg-dark-top), var(--bg-dark-bottom));
    color: var(--text-light);
    padding: 5rem 0 6rem;
}

.gallery-inner {
    max-width: 1200px;
}

.gallery .section-title-left {
    margin-left: 0;
    padding-left: 0;
}

.gallery-track {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    margin-top: 3rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

.gallery-grid img,
.gallery-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover,
.gallery-image:hover {
    transform: scale(1.05);
}

.gallery-arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.gallery-arrow:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
}

.gallery-arrow:disabled {
    cursor: not-allowed;
}

/* Lightbox (full-screen gallery) */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 18, 0.88); /* softer, warm dark overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 100;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: min(900px, 100%);
    max-height: 80vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

.lightbox-caption {
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0.85;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Override base .gallery-arrow look so we only see the icons */
    width: auto;
    height: auto;
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0;
}

.lightbox-arrow:hover:not(:disabled) {
    background: transparent;
}

.lightbox-arrow-left {
    left: 2rem;
}

.lightbox-arrow-right {
    right: 2rem;
}

.lightbox-arrow:disabled {
    opacity: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    .lightbox {
        padding: 1.5rem;
    }

    .lightbox-arrow-left {
        left: 1rem;
    }

    .lightbox-arrow-right {
        right: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-grid img {
        transition: none;
    }
    
    .gallery-grid img:hover {
        transform: none;
    }
}

/* CTA Section */
.cta {
    position: relative;
    background-image: url('images/Oflline_delavnica.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
    width: 100%;
    color: var(--text-dark);
    text-align: center;
}

.cta-overlay {
    /* Removed dark gradient overlay so the background image is fully visible */
    background: none;
    padding: 6rem 0 5rem;
}

.cta-inner {
    max-width: 720px;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 3rem 0 2rem;
}

.cta-contact {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    font-weight: 500;
}

.cta-small {
    font-size: 0.9rem;
    opacity: 0.7;
}

.cta-terms-link {
    margin-top: 0.75rem;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: var(--button-color);
    text-decoration: underline;
    cursor: pointer;
}

.cta-terms-link:hover {
    color: var(--button-color-light);
}

/* Terms & Conditions Overlay */
.terms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 18, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 110;
}

.terms-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.terms-dialog {
    background: #f5eee0;
    color: var(--text-dark);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    position: relative;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.terms-body {
    margin-top: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.terms-dialog h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.terms-body h3 {
    font-size: 1.05rem;
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.terms-body p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
}

.terms-date {
    margin-top: 1.5rem;
    font-style: italic;
}

.terms-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.terms-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Footer */
.footer {
    background-color: var(--bg-dark-top);
    color: var(--footer-text);
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-logo {
    max-width: 36px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.footer-content {
    margin-bottom: 2rem;
    line-height: 1.8;
    text-align: center;
    font-size: 0.9em;
}

.footer-content p {
    margin: 0.5rem 0;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-social a {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-social a:hover {
    opacity: 1;
}

.footer-social img {
    width: 32px;
    height: 32px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .header-logo {
        margin-top: 5px;
        margin-bottom: 5px;
    }
    
    .hero {
        min-height: auto;
        padding: 3.5rem 0 3rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        text-align: center;
    }
    
    .hero-grid,
    .material-inner {
        grid-template-columns: 1fr;
    }
    
    .hero-media {
        order: 1;
        margin-top: -1.5rem;
    }
    
    .hero-copy {
        order: 2;
    }
    
    .hero-photo {
        width: 88%;
        max-width: 329px;
    }
    
    .experience-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .experience-left {
        order: 1;
    }
    
    .experience-image-wrap {
        order: 2;
    }
    
    .experience-content {
        order: 3;
        margin: 0;
    }
    
    .material-copy {
        margin: 0;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .material-images {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .gallery-track {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 2rem;
        justify-items: center;
    }
    
    .gallery-grid {
        grid-row: 1;
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
    }
    
    .gallery-arrow-left {
        grid-row: 2;
        grid-column: 1;
        justify-self: center;
        transform: translateX(-30px);
    }
    
    .gallery-arrow-right {
        grid-row: 2;
        grid-column: 1;
        justify-self: center;
        transform: translateX(30px);
    }
    
    .gallery-arrow-left,
    .gallery-arrow-right {
        position: relative;
        margin: 0;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .process-steps {
        gap: 2rem;
    }
    
    .floating-accent {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .about-name {
        font-size: 2rem;
    }
}

