/* =========================================================================
   Damjan Volk s.p. — bespoke light "studio" theme (no framework)
   ========================================================================= */

:root {
    --canvas:      #ffffff;
    --alt:         #f4f6f9;
    --stage:       #eef1f5;
    --ink:         #0e1726;
    --ink-soft:    #33445a;
    --muted:       #64748b;
    --line:        #e5e9ef;
    --line-strong: #d4dae2;
    --accent:      #1f6feb;
    --accent-ink:  #14539d;
    --accent-soft: rgba(31, 111, 235, .10);
    --on-accent:   #ffffff;
    --shadow-sm:   0 1px 2px rgba(14, 23, 38, .05);
    --shadow-md:   0 10px 30px rgba(14, 23, 38, .08);
    --shadow-lg:   0 30px 70px rgba(14, 23, 38, .16);
    --r:           18px;
    --r-sm:        12px;
    --maxw:        1200px;
    --ff-display:  "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ff:          "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--ff);
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--ink-soft);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
    font-family: var(--ff-display);
    color: var(--ink);
    line-height: 1.08;
    letter-spacing: -.02em;
    margin: 0;
    font-weight: 600;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-ink); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 5px; }

.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: -60px; left: 12px; z-index: 3000;
    padding: .6rem 1rem; background: var(--accent); color: var(--on-accent);
    border-radius: 0 0 10px 10px; transition: top .2s ease;
}
.skip-link:focus { top: 0; color: var(--on-accent); }

.eyebrow {
    display: inline-block; font-family: var(--ff);
    font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: var(--accent); margin-bottom: .9rem;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--ff); font-weight: 600; font-size: 1rem; line-height: 1;
    padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease, border-color .16s ease, color .16s ease;
    white-space: nowrap;
}
.btn-lg { padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: var(--accent-ink); color: var(--on-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--alt); color: var(--ink); border-color: var(--muted); transform: translateY(-2px); }

.link-more {
    display: inline-flex; align-items: center; gap: .45rem;
    font-weight: 600; color: var(--accent); font-family: var(--ff);
}
.link-more svg { transition: transform .18s ease; }
.link-more:hover svg { transform: translateX(4px); }

/* ---- Header / nav ------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav-bar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--accent); color: #fff;
    font-family: var(--ff-display); font-weight: 700; font-size: .95rem; letter-spacing: -.02em;
}
.brand-name { font-family: var(--ff-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; }
.brand-suffix { color: var(--muted); font-weight: 500; margin-left: .35rem; }

.nav-menu { display: flex; }
.nav-list { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }

.nav-link {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--ff); font-size: .97rem; font-weight: 500; color: var(--ink-soft);
    background: none; border: 0; cursor: pointer;
    padding: .55rem .8rem; border-radius: 9px; transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--alt); }
.nav-link.is-active { color: var(--accent); }
.nav-caret::after {
    content: ""; width: 7px; height: 7px; margin-left: .15rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .18s ease;
}
.has-menu.open > .nav-caret::after { transform: rotate(-135deg) translateY(-1px); }

.has-menu { position: relative; }
.submenu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px;
    list-style: none; margin: 0; padding: .4rem;
    background: var(--canvas); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.submenu-end { left: auto; right: 0; min-width: 120px; }
.has-menu.open > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a {
    display: block; padding: .6rem .8rem; border-radius: 9px;
    color: var(--ink-soft); font-weight: 500; font-size: .95rem;
}
.submenu a:hover { background: var(--alt); color: var(--ink); }
.submenu a.is-active { color: var(--accent); background: var(--accent-soft); }

.nav-cta-item { display: none; margin-left: .4rem; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; justify-content: center;
    width: 44px; height: 44px; padding: 0 10px; background: none; border: 0; cursor: pointer;
}
.nav-toggle span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 981px) {
    /* Hover-open dropdowns on pointer devices. */
    @media (hover: hover) {
        .has-menu:hover > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
        .has-menu:hover > .nav-caret::after { transform: rotate(-135deg) translateY(-1px); }
    }
    .nav-cta-item { display: list-item; }
}

@media (max-width: 980px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed; inset: 68px 0 auto 0;
        background: var(--canvas); border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        max-height: 0; overflow: hidden; transition: max-height .28s ease;
    }
    .site-header.is-open .nav-menu { max-height: calc(100vh - 68px); overflow-y: auto; }
    .nav-list { flex-direction: column; align-items: stretch; gap: .1rem; padding: 1rem 1.5rem 1.5rem; }
    .nav-link { padding: .8rem .2rem; font-size: 1.05rem; }
    .submenu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: 0; padding: 0 0 .4rem .8rem; min-width: 0;
        max-height: 0; overflow: hidden; transition: max-height .24s ease;
    }
    .has-menu.open > .submenu { max-height: 320px; }
    .submenu-end { right: auto; }
}

/* ---- Sections ----------------------------------------------------------- */

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--alt); }

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-head-sub { margin-top: clamp(3rem, 6vw, 4.5rem); }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.section-title { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 600; }
.section-lead { color: var(--muted); font-size: 1.12rem; margin-top: 1rem; max-width: 60ch; }

/* ---- Hero --------------------------------------------------------------- */

.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.hero-copy { max-width: 820px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.hero-title {
    font-size: clamp(2.4rem, 5.6vw, 4.3rem); font-weight: 600; letter-spacing: -.03em;
    margin: 0 0 1.25rem;
}
.hero-sub { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--muted); max-width: 52ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Contained banner slider — matches each purpose-built image's aspect ratio
   so the wide desktop / 3:2 tablet / portrait mobile crops fill cleanly. */
.hero-banner {
    position: relative; width: 100%;
    aspect-ratio: 1489 / 542;              /* desktop panoramic */
    background: var(--stage); overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-md);
}
.banner-slides { position: absolute; inset: 0; }
.banner-slide {
    position: absolute; inset: 0; margin: 0;
    opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s;
}
.banner-slide.is-active { opacity: 1; visibility: visible; }
.banner-slide picture, .banner-slide img, .banner-slide video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}

/* caption card sits at the banner's bottom-left */
.banner-caption { position: absolute; left: 0; bottom: 0; padding: clamp(1rem, 3vw, 1.75rem); }
.cap-card {
    max-width: 400px; padding: 1.1rem 1.3rem; color: var(--ink);
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md);
}
.cap-card p { font-size: .95rem; color: var(--muted); margin-bottom: .6rem; }
.stage-label { display: block; font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.25rem, 2.2vw, 1.6rem); color: var(--ink); margin-bottom: .25rem; }

.banner-nav { position: absolute; top: 0; right: 0; padding: clamp(1rem, 3vw, 1.5rem); display: flex; justify-content: flex-end; }
.stage-dots { display: flex; gap: .45rem; }
.stage-dots button {
    width: 30px; height: 5px; padding: 0; border-radius: 5px; cursor: pointer; border: 0;
    background: rgba(14, 23, 38, .22); transition: background .2s ease;
}
.stage-dots button.is-active { background: var(--accent); }

@media (max-width: 1199px) { .hero-banner { aspect-ratio: 3 / 2; } }
@media (max-width: 599px)  { .hero-banner { aspect-ratio: 1064 / 1530; } }

/* ---- Services showcase (zig-zag) --------------------------------------- */

.showcase { display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 6rem); }
.showcase-row { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.showcase-row.is-reversed .showcase-media { order: 2; }
.showcase-media {
    display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
    background: radial-gradient(120% 100% at 50% 25%, #ffffff 0%, var(--stage) 70%);
    aspect-ratio: 16 / 11;
}
.showcase-media img { width: 100%; height: 100%; object-fit: contain; padding: clamp(1rem, 4%, 2.5rem); transition: transform .4s ease; }
.showcase-media:hover img { transform: scale(1.03); }
.showcase-index { font-family: var(--ff-display); font-size: .9rem; font-weight: 600; color: var(--accent); letter-spacing: .1em; }
.showcase-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 600; margin: .5rem 0 1rem; }
.showcase-copy p { color: var(--muted); font-size: 1.08rem; margin-bottom: 1.4rem; }

@media (max-width: 820px) {
    .showcase-row, .showcase-row.is-reversed { grid-template-columns: 1fr; gap: 1.5rem; }
    .showcase-row.is-reversed .showcase-media { order: 0; }
}

/* ---- Selected work grid ------------------------------------------------- */

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.work-tile {
    display: flex; flex-direction: column; border-radius: var(--r-sm); overflow: hidden;
    background: var(--canvas); border: 1px solid var(--line); color: var(--ink);
    box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.work-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); color: var(--ink); }
.work-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--stage); }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.work-tile:hover .work-media img { transform: scale(1.05); }
.work-caption { padding: .8rem 1rem 1rem; font-weight: 500; font-size: .92rem; color: var(--ink-soft); }

/* ---- Clients ------------------------------------------------------------ */

.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.client-card { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.section-alt .client-card { background: var(--canvas); }
.client-logo { height: 46px; margin-bottom: 1.25rem; display: flex; align-items: center; }
.client-logo img { max-height: 46px; width: auto; object-fit: contain; }
.client-name { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.client-card p { color: var(--muted); font-size: .95rem; }

/* ---- Profile ------------------------------------------------------------ */

.profile { display: grid; grid-template-columns: 200px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.profile-pic { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 4px solid var(--canvas); box-shadow: var(--shadow-md); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.profile-item h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; }
.profile-item p { color: var(--muted); font-size: .97rem; }

@media (max-width: 700px) {
    .profile { grid-template-columns: 1fr; justify-items: start; }
}

/* ---- Contact ------------------------------------------------------------ */

.contact-block { max-width: 640px; }
.contact-details { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .7rem; font-size: 1.1rem; }
.contact-details a { color: var(--ink); }
.contact-details a:hover { color: var(--accent); }
.contact-name { font-family: var(--ff-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---- Footer ------------------------------------------------------------- */

.site-footer { background: var(--ink); color: #aeb9c7; padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; }
.brand-footer .brand-name, .brand-footer { color: #fff; }
.brand-footer .brand-suffix { color: #8595a8; }
.footer-tagline { margin-top: .8rem; max-width: 30ch; color: #8595a8; }
.footer-contact, .footer-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-nav { align-content: start; }
.footer-contact a, .footer-nav a { color: #aeb9c7; }
.footer-contact a:hover, .footer-nav a:hover { color: #fff; }
.footer-copy { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9rem; color: #7c889a; }

/* ---- Breadcrumb + gallery ---------------------------------------------- */

.breadcrumb-nav { display: flex; gap: .55rem; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
.breadcrumb-nav span[aria-current] { color: var(--ink); font-weight: 500; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.tile {
    display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
    background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm);
    overflow: hidden; box-shadow: var(--shadow-sm); color: var(--ink);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.tile-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--stage); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.tile:hover .tile-media img { transform: scale(1.05); }
.tile-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .55rem; }
.tile-caption { font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--ink); }
.tile-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge-tag { font-size: .68rem; font-weight: 600; letter-spacing: .03em; padding: .22rem .6rem; border-radius: 999px; }
.badge-design { background: #eef1f5; color: #465569; }
.badge-construction { background: #e4e9f0; color: #2f3e53; }
.badge-visualization { background: var(--accent-soft); color: var(--accent-ink); }
.badge-animation { background: #fdece7; color: #c1472e; }

/* ---- Lightbox ----------------------------------------------------------- */

.lightbox {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
    padding: clamp(1rem, 4vw, 3rem); background: rgba(9, 15, 24, .88); backdrop-filter: blur(5px);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1100px, 92vw); max-height: 88vh; display: flex; flex-direction: column; gap: .75rem; }
.lightbox-img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; margin: 0 auto; background: #fff; box-shadow: var(--shadow-lg); }
.lightbox-caption { color: #e9eef4; text-align: center; font-weight: 500; }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; cursor: pointer;
    border-radius: 999px; display: flex; align-items: center; justify-content: center; transition: background .15s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, .3); }
.lightbox-close { top: 1.1rem; right: 1.1rem; width: 46px; height: 46px; font-size: 1.9rem; line-height: 1; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 2.3rem; line-height: 1; }
.lightbox-prev { left: 1rem; } .lightbox-next { right: 1rem; }
@media (max-width: 560px) { .lightbox-prev, .lightbox-next { width: 42px; height: 42px; font-size: 1.7rem; } }

/* ---- Animation gallery -------------------------------------------------- */

.animation-stage { margin-bottom: 1.75rem; }
.animation-player { width: 100%; max-height: 70vh; border-radius: var(--r); background: #000; box-shadow: var(--shadow-md); aspect-ratio: 16 / 9; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.video-tile { display: flex; flex-direction: column; gap: .6rem; padding: 0; background: none; border: 0; cursor: pointer; color: var(--ink); text-align: left; }
.video-thumb { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; box-shadow: var(--shadow-sm); }
.video-tile.is-active .video-thumb { border-color: var(--accent); }
.video-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.play-badge { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: rgba(9, 15, 24, .55); color: #fff; border-radius: 999px; transition: background .15s ease, transform .15s ease; }
.video-tile:hover .play-badge { background: var(--accent); transform: scale(1.06); }

/* ---- Error page --------------------------------------------------------- */

.error-section { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.error-code { font-family: var(--ff-display); font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; color: var(--accent); line-height: 1; margin: 0; }
.error-section .section-title { margin-top: .5rem; }
.error-section .section-lead { margin: .75rem auto 2rem; }

/* ---- Motion ------------------------------------------------------------- */

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