/**
 * Izulica Portfolio Theme PACKAGED v:1.0.1
 *
 * Use the theme's glyph masks, cutoff geometry and disclosure on the standalone page.
 *
 * Contents
 * 1. Navigation
 * 2. Cutoff controls
 * 3. Word and underline entrances
 * 4. Compact menu
 *
 * @author Tibi - FWDesign [https://fwdapps.net/]
 * Copyright (c) Since 2006 Tibi - FWDesign.
 */


/* ################################################# */
/* 1. Navigation */
/* ################################################# */

@font-face {
    font-family: Teko;
    src: url("teko-light.woff2") format("woff2");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

:root {
    --izulica-green: var(--accent, #00ff00);
    --izulica-text-reveal-ease: linear(0, 0.41 10%, 0.672 20%, 0.832 30%, 0.922 40%, 0.969 50%, 0.99 60%, 0.998 70%, 1);
}

.masthead {
    position: relative;
    z-index: 3;
    align-items: flex-start;
    padding-top: 45px;
}

.masthead nav {
    margin-top: -12px;
}

.masthead .izulica-identity {
    --izulica-title-size: 1.25rem;
    margin-top: -4px;
    flex: 1 1 0%;
    min-width: 0;
    line-height: var(--izulica-title-size);
}

.masthead .brand {
    position: relative;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 0.36em;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    font: 300 var(--izulica-title-size, 1.25rem)/1 Teko, sans-serif;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow-wrap: normal;
    --izulica-link-active: 0;
}

.masthead .brand .brand-name {
    display: block;
}

.masthead .brand .mark {
    display: block;
    height: calc(1cap + 1px);
    width: auto;
    aspect-ratio: 46 / 40;
}

.izulica-header-mark-reveal {
    display: block;
    overflow: clip;
}

.izulica-brand :is(.izulica-link-rest, .izulica-link-hover) {
    grid-area: 1 / 2;
    inline-size: max-content;
    min-width: 0;
}

.masthead .brand.izulica-mark-only {
    grid-template-columns: max-content;
}

.izulica-brand.izulica-mark-only :is(.izulica-link-rest, .izulica-link-hover),
.izulica-brand.izulica-no-hover-title .izulica-link-hover {
    position: absolute;
    visibility: hidden;
}

.izulica-link-rest {
    --izulica-word-hidden: var(--izulica-link-active);
    --izulica-link-direction: -1;
    color: var(--izulica-green);
}

.izulica-link-hover {
    --izulica-word-hidden: calc(1 - var(--izulica-link-active));
    --izulica-link-direction: 1;
    color: #fff;
    letter-spacing: 0.035em;
    pointer-events: none;
}

/* Keep the site name visible in the compact header and on touch devices. */
@media (max-width: 840px), (hover: none) {
    .izulica-brand .izulica-link-hover {
        display: none;
    }
}

@media (width > 840px) and (hover: hover) {
    .izulica-hover-link:where(:not(.izulica-no-hover-title)):is(:hover, :focus-visible, [data-izulica-hold-title]) {
        --izulica-link-active: 1;

        & .izulica-link-hover .izulica-link-word {
            transform: none;

            /* Keep the same painted letters through the final moving frame and a click. */
            @media (prefers-reduced-motion: no-preference) {
                will-change: transform;
            }
        }
    }
}

@media (prefers-reduced-motion: no-preference) {
    html.izulica-smooth-anchor {
        scroll-behavior: smooth;
    }

    .izulica-hover-link.izulica-setting-pattern .izulica-link-word {
        transition: none;
    }

    .izulica-link-word {
        display: block;
        transform-origin: var(--izulica-link-pivot);
        opacity: calc(1 - var(--izulica-word-hidden));

        /* Tilt the far end away from the mask on both entry and exit. */
        --izulica-link-travel: max(125%, var(--izulica-hidden-travel));
        transform: translate3d(0, calc(var(--izulica-link-travel) * var(--izulica-link-direction) * var(--izulica-word-hidden)), 0)
            rotate(calc(var(--izulica-link-angle) * var(--izulica-link-direction) * var(--izulica-word-hidden)));
        transition-property: transform, opacity;
        transition-duration: 1s;
        transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
        transition-delay: var(--izulica-link-delay);
    }
}

@media (prefers-reduced-motion: reduce) {
    .izulica-link-rest,
    .izulica-link-hover {
        opacity: calc(1 - var(--izulica-word-hidden));
    }
}


@media (min-width: 1920px) {
    .masthead .izulica-identity {
        --izulica-title-size: 1.625rem;
        margin-top: -7px;
    }
}

.masthead .izulica-menu {
    display: flex;
    gap: 0.25rem 28px;
    align-items: baseline;
    padding: 0;
    margin: 0;
    list-style: none;
    font-family: "IBM Plex Sans", sans-serif;
    letter-spacing: 0.25px;
}

.izulica-menu > li {
    position: relative;
    margin-inline: -8px;
}

.masthead .izulica-menu a {
    display: block;
    padding: 12px 8px;
    color: #fff;
    font: 400 1rem/0.625rem "IBM Plex Sans", sans-serif;
    white-space: nowrap;
    --izulica-cutoff-inset: -1px -6px;
}

.masthead .izulica-menu a > .izulica-button-ink {
    padding: 13px 14px;
}


/* ################################################# */
/* 2. Cutoff controls */
/* ################################################# */

.izulica-demo-control .izulica-action-label {
    display: inline-block;
    position: relative;
    vertical-align: top;
}

.izulica-icon-label,
.izulica-demo-control .izulica-icon-label {
    display: inline-flex;
    align-items: center;
    column-gap: 0.375em;
    white-space: nowrap;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--izulica-green);
}

/* The underline moves with the words and arrow as the green hover fill passes over them. */
.izulica-button-ink .izulica-icon-label {
    border-bottom-color: currentColor;
}

/* Paint the resting demo rule on the link, outside its rotating text mask. */
.intro-detail .underlink {
    position: relative;
    padding: 0;
}

.intro-detail .underlink:not(.izulica-demo-control) {
    display: inline-flex;
}

.intro-detail .underlink::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 1px 0 rgb(0 0 0 / 65%);
    pointer-events: none;
}

.intro-detail .underlink > .izulica-icon-label,
.intro-detail .underlink > .izulica-action-clip .izulica-icon-label {
    border-bottom-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
    .intro-detail .izulica-demo-link-entering:not(:focus-visible)::after {
        visibility: hidden;
    }

    .intro-detail .izulica-demo-link-entering:not(:focus-visible) > .izulica-action-clip .izulica-icon-label {
        border-bottom-color: var(--accent);
    }
}

.izulica-icon-label svg {
    display: block;
    flex: none;
    width: 0.9em;
    height: 0.9em;
    fill: currentColor;
}

.izulica-action-clip {
    /* Leave room for the rotating underline and keep the link's original layout height. */
    --izulica-hidden-travel: calc(100% + 4px);
    padding-bottom: 4px;
    margin-bottom: -4px;
    display: block;
    overflow: hidden;
    overflow: clip;
}

/* The underlying letters retain their normal color as the black copy sweeps across them. */
.example-preview:is(:active, :focus-visible) .example-title,
.filters input:checked + .izulica-demo-control,
.filters input:focus-visible + .izulica-demo-control,
.izulica-menu a[aria-current="location"],
.izulica-mobile-toggle[aria-expanded="true"] {
    --izulica-button-open: 1;
    --izulica-corner-delays: var(--izulica-open-delays);
}

@media (hover: hover) {
    .example-preview:hover .example-title,
    .filters label:hover .izulica-demo-control {
        --izulica-button-open: 1;
        --izulica-corner-delays: var(--izulica-open-delays);
    }
}

.izulica-demo-control.underlink {
    --izulica-ink-padding-inline: calc(5% + 3.63px);
    --izulica-cutoff-inset: -9px calc(0px - var(--izulica-ink-padding-inline));
    --izulica-cutoff-slant: min(4%, 3.63px);
    display: inline-block;
    padding: 0;
    width: fit-content;
    font: 500 var(--action-size, 0.9375rem)/1.45 "IBM Plex Sans", sans-serif;
    text-decoration: none;
    background: transparent;
}

.footer-actions .izulica-demo-control.underlink {
    --izulica-ink-padding-inline: 3px;
}

.izulica-demo-control.underlink > .izulica-button-ink {
    padding: 9px var(--izulica-ink-padding-inline);
}

.izulica-demo-control.underlink .izulica-action-label:not(.izulica-icon-label)::after {
    position: absolute;
    content: "";
    inset-inline: 0;
    bottom: 0;
    height: 1px;
    background-color: var(--izulica-green);
}

.izulica-demo-control.underlink > .izulica-button-ink .izulica-action-label:not(.izulica-icon-label)::after {
    background-color: #000;
}

/* Inset and padding are paired to keep the black title registered with its white copy. */
.example-title.izulica-demo-control {
    --izulica-cutoff-inset: -0.12em -0.18em;
    --izulica-cutoff-slant: min(4%, 0.14em);
    --izulica-cutoff-rise: 12%;
    --izulica-cutoff-fall: 14%;
}

.example-title > .izulica-button-ink {
    background-color: var(--example-title-fill, var(--izulica-green));
    color: var(--example-title-ink, #000);
    padding: 0.12em 0.18em;
}

/* Small titles retain a 44px touch target without changing caption spacing. */
.example-title::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block: min(0px, calc(50% - 22px));
}

.izulica-menu a.izulica-demo-control::before {
    content: none;
}

.filters .izulica-demo-control {
    --izulica-cutoff-inset: -1px -2px;
    color: var(--paper);
    text-decoration: none;
}

.filters .izulica-demo-control > .izulica-button-ink {
    padding: calc(0.6rem + 1px) calc(var(--filter-inline, 0.8rem) + 2px);
    color: #000;
}

.filters input:checked + .izulica-demo-control {
    text-decoration: none;
}


/* ################################################# */
/* 3. Word and underline entrances */
/* ################################################# */

@media (prefers-reduced-motion: no-preference) {
    .izulica-intro-preparing .intro :is(.eyebrow, h1, .intro-detail > p) {
        opacity: 0;
    }

    /* A line keeps its original baseline while the measured ink rotates inside it. */
    .izulica-reveal-line {
        display: block;
    }

    .izulica-word-mask,
    .izulica-link-word-mask {
        /* Rotated letters must clear the ink mask even when the line is shorter than the font. */
        --izulica-hidden-travel: max(
            calc(1em + 2px),
            calc(100% - min(0px, var(--izulica-word-top, 0px)) - min(0px, var(--izulica-word-bottom, 0px)) + 2px)
        );
        display: inline-block;
        margin-block: var(--izulica-word-top, 0px) var(--izulica-word-bottom, 0px);

        /* Allow for ink at fractional horizontal pixel positions. */
        padding-inline: 1px;
        margin-inline: -1px;
        max-width: 100%;
        /* The mask clips rotating ink without creating a scroll container for each word. */
        overflow: hidden;
        overflow: clip;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    /* Each row already represents one measured line of the original paragraph. */
    .izulica-reveal-line > .izulica-word-mask {
        white-space: nowrap;
        max-width: none;
    }

    /* Keep button words intact in both the resting label and the cutoff overlay. */
    :is(.izulica-menu, .izulica-action-label) .izulica-word-mask {
        white-space: nowrap;
        max-width: none;
    }

    /* Keep the baseline and line spacing while trimming the stationary mask. */
    :is(.izulica-word-mask, .izulica-link-word-mask) > span {
        margin-block: calc(0px - var(--izulica-word-top, 0px)) calc(0px - var(--izulica-word-bottom, 0px));
    }

    .izulica-reveal-word,
    .izulica-header-mark-reveal > * {
        display: block;

        /* Keep the resting glyphs on the same surface as the final reveal frame. */
        transform: translate3d(0, 0, 0);
        transform-origin: var(--izulica-word-pivot);
    }

    .izulica-reveal-word,
    .izulica-header-mark-reveal > * {
        animation: izulica-reveal-word 1s cubic-bezier(0.22, 1, 0.36, 1) var(--izulica-word-delay, 0ms) backwards;
        animation-timing-function: var(--izulica-text-reveal-ease);
    }

}

/* Keep the content readable in print and when the visitor prefers reduced motion. */
@media screen and (prefers-reduced-motion: no-preference) {
    .izulica-controls-pending .features :is(h2, h3, .feature-text p, figcaption, .feature-notes p),
    .features .izulica-feature-pending:not(article) {
        opacity: 0;
    }

    .izulica-feature-icon-mask {
        display: block;
        flex: none;
        overflow: clip;
    }

    .izulica-controls-pending .feature-notes article::before,
    .feature-notes article.izulica-feature-pending::before {
        clip-path: inset(0 100% 0 0);
    }

    .feature-notes article.izulica-divider-drawing::before {
        animation: izulica-draw-divider 1s cubic-bezier(0.35, 0.08, 0.45, 1) backwards;
    }
}

@keyframes izulica-draw-divider {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0);
    }
}

@keyframes izulica-reveal-menu-fill {
    from, to {
        mask-image: linear-gradient(to top, black 50%, transparent 50%);
        mask-repeat: no-repeat;
        mask-size: 100% 200%;
    }
    from {
        mask-position: center top;
    }
    to {
        mask-position: center bottom;
    }
}

@keyframes izulica-reveal-word {
    from {
        transform: translate3d(var(--izulica-enter-x, 0px), var(--izulica-enter-y, var(--izulica-hidden-travel, 100%)), 0) rotate(var(--izulica-word-angle));
    }

    to {
        transform: translate3d(0, 0, 0) rotate(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .izulica-controls-pending :is(.masthead .brand, .masthead nav, .underlink, .example-title, .filters label, #examples-title, .example-caption p),
    .izulica-demo-pending {
        opacity: 0;
    }

    .izulica-demo-control.underlink .izulica-action-label:not(.izulica-icon-label)::after {
        transform-origin: var(--izulica-action-pivot-x) calc(2px - 1lh);
        animation: izulica-read-underline-turn 1s var(--izulica-text-reveal-ease) var(--izulica-word-delay, 0ms) backwards;
    }

    .izulica-demo-control > .izulica-button-ink {
        /* The animation supplies its own mask and releases the compositing layer at rest. */
        animation: izulica-reveal-menu-fill 1s var(--izulica-text-reveal-ease) var(--izulica-word-delay, 0ms) backwards;
    }

    /* Offscreen controls start their own timelines when they enter the viewport. */
    .izulica-demo-pending .izulica-reveal-word,
    .izulica-demo-pending > .izulica-button-ink,
    .izulica-demo-pending.izulica-demo-control.underlink .izulica-action-label::after {
        animation-name: none;
    }

    /* Start the intro link's clock with the heading after the page sets its final line breaks. */
    .izulica-intro-preparing .intro .underlink:not(:focus-visible) {
        opacity: 0;
    }

    .izulica-intro-preparing .intro .underlink .izulica-icon-label,
    .izulica-intro-preparing .intro .underlink > .izulica-button-ink {
        animation-name: none;
    }

    /* Give a keyboard visitor the complete action as soon as the link receives focus. */
    .example-preview:focus-visible .example-title .izulica-reveal-word,
    .example-preview:focus-visible .example-title > .izulica-button-ink,
    .izulica-demo-control:focus-visible .izulica-icon-label,
    .izulica-demo-control:has(.izulica-icon-label):focus-visible > .izulica-button-ink {
        animation-name: none;
    }

    /* The canvas precedes the features section. Checking those siblings keeps text reveals from invalidating the whole page. */
    :is(.izulica-mesh-pending, .izulica-project-scene-canvas ~ .features)
        .wp-block-video:not(.izulica-film-revealed) > .izulica-film-toggle:not(:focus-visible) {
        opacity: 0;
        pointer-events: none;
    }

    .izulica-film-revealed > .izulica-film-toggle {
        transform-origin: right top;
        animation: izulica-reveal-film-control 1s var(--izulica-text-reveal-ease) backwards;
    }
}

@keyframes izulica-reveal-film-control {
    from {
        clip-path: inset(0 0 100%);
        transform: translateY(0.65em) rotate(-10deg);
    }

    to {
        clip-path: inset(0);
        transform: none;
    }
}

@keyframes izulica-read-underline-turn {
    from {
        transform: translateY(1lh) rotate(var(--izulica-action-angle));
        opacity: 0;
    }

    to {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}


/* ################################################# */
/* 4. Compact menu */
/* ################################################# */

.izulica-mobile-toggle {
    display: none;
}

@media (max-width: 840px) {
    .masthead {
        padding-top: 39px;
    }

    .masthead .izulica-identity {
        margin-top: 3px;
    }

    .izulica-menu-ready > .izulica-mobile-toggle:not([hidden]) {
        position: relative;
        isolation: isolate;
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--izulica-menu-text, #fff);
        cursor: pointer;
    }

    .izulica-mobile-toggle:focus-visible {
        outline: 1px solid var(--izulica-green);
        outline-offset: 2px;
    }

    .izulica-mobile-toggle::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--izulica-menu-background, transparent);
    }

    .izulica-mobile-icon {
        display: grid;
        grid-area: 1 / 1;
        place-items: center;
    }

    .izulica-mobile-toggle > .izulica-button-ink {
        display: grid;
        place-items: center;
        inset: 0;
        background-color: var(--izulica-menu-hover-background, var(--izulica-green));
        color: var(--izulica-menu-hover-text, #000);
    }

    .izulica-mobile-toggle[aria-expanded="true"] {
        --izulica-button-open: 1;
        --izulica-corner-delays: var(--izulica-open-delays);
    }

    /* Each mask moves into the close icon independently of the entrance playing inside it. */
    .izulica-mobile-stroke {
        --izulica-hidden-travel: 1.25rem;
        grid-area: 1 / 1;
        width: 20px;
        height: 2px;
        overflow: hidden;
    }

    .izulica-mobile-stroke > span {
        display: block;
        height: 100%;
        background: currentColor;
    }

    .izulica-mobile-stroke:first-child {
        transform: translateY(-6px);
    }

    .izulica-mobile-stroke:last-child {
        transform: translateY(6px);
    }

    .izulica-mobile-toggle[aria-expanded="true"] .izulica-mobile-icon > :first-child {
        transform: rotate(45deg);
    }

    .izulica-mobile-toggle[aria-expanded="true"] .izulica-mobile-icon > :last-child {
        transform: rotate(-45deg);
    }

    .izulica-mobile-toggle[aria-expanded="true"] .izulica-mobile-icon > :nth-child(2) {
        transform: scaleX(0);
    }

    .izulica-menu-ready > .izulica-menu {
        display: none;
        position: absolute;
        z-index: 4;
        inset-inline: var(--izulica-gutter);
        top: calc(100% + 12px);
        isolation: isolate;
        box-sizing: border-box;
        padding: 1rem 1.25rem;
        margin: 0;
    }

    .izulica-mobile-open > .izulica-menu {
        display: block;
    }

    .izulica-mobile-open > .izulica-menu::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: #181818;
        pointer-events: none;
    }

    .izulica-mobile-open .izulica-menu > li {
        margin: 0;
    }

    .izulica-mobile-open .izulica-menu > li > a {
        inline-size: fit-content;
        max-inline-size: 100%;
        box-sizing: border-box;
        padding-block: 0.5rem;
        line-height: 1.25;
    }

    .izulica-mobile-open .izulica-menu > li > a > .izulica-button-ink {
        padding-block: calc(0.5rem + 1px);
    }

    .masthead .izulica-menu-ready > .izulica-menu {
        inset-inline: var(--gutter);
        top: 100%;
    }

    .masthead .izulica-mobile-open > .izulica-menu {
        display: block;
    }

    .masthead .izulica-mobile-open .izulica-menu a {
        inline-size: fit-content;
        padding-block: 0.5rem;
        line-height: 1.25;
    }

    .masthead .izulica-mobile-open .izulica-menu a > .izulica-button-ink {
        padding-block: calc(0.5rem + 1px);
    }

    .izulica-mobile-open > .izulica-menu::before {
        --izulica-cutoff-first: 1;
        --izulica-cutoff-second: 1;
        /* Each side unfolds from the top, carrying its bevel to the final panel outline. */
        --izulica-playlist-outline: polygon(
            0 0,
            calc(100% - 18px) 0,
            100% calc(18px * var(--izulica-cutoff-first)),
            100% calc(100% * var(--izulica-cutoff-first)),
            18px calc(100% * var(--izulica-cutoff-second)),
            0 calc((100% - 18px) * var(--izulica-cutoff-second))
        );
        clip-path: var(--izulica-playlist-outline);
    }
}

@media (max-width: 840px) and (prefers-reduced-motion: no-preference) {
    .izulica-mobile-stroke {
        transition: transform 240ms ease;
    }

    .izulica-mobile-open > .izulica-menu::before {
        /* The corner below the toggle leads. Keep the full panel reveal at its original pace. */
        animation-name: izulica-playlist-first-corner, izulica-playlist-second-corner;
        animation-duration: calc(780ms - var(--izulica-corner-stagger));
        animation-timing-function: var(--izulica-corner-ease);
        animation-delay: 0ms, var(--izulica-corner-stagger);
        animation-fill-mode: backwards;
    }
}

@keyframes izulica-playlist-first-corner {
    from {
        --izulica-cutoff-first: 0;
    }

    to {
        --izulica-cutoff-first: 1;
    }
}

@keyframes izulica-playlist-second-corner {
    from {
        --izulica-cutoff-second: 0;
    }

    to {
        --izulica-cutoff-second: 1;
    }
}

@media (max-width: 600px) {
    .filters .izulica-demo-control {
        --filter-inline: 0.5rem;
    }
}
