/**
 * Izulica Portfolio Theme PACKAGED v:1.0.1
 *
 * Style the standalone demo index with the theme's type, cutoff shapes and imagery.
 *
 * Contents
 * 1. Foundations
 * 2. Masthead and links
 * 3. Fullscreen opening and accordion
 * 4. Live example grid
 * 5. Features and footer
 * 6. Responsive layout
 *
 * @author Tibi - FWDesign [https://fwdapps.net/]
 * Copyright (c) Since 2006 Tibi - FWDesign.
 */


/* ################################################# */
/* 1. Foundations */
/* ################################################# */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("ibm-plex-sans-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("ibm-plex-sans-medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

:root {
    --ink: #000;
    --paper: #f7f7f3;
    --accent: #00ff00;
    --muted: #a3a3a3;
    --izulica-journal-rule: #383838;
    --gutter: 45px;
    --page-max-width: 1920px;
    --section-heading-gap: clamp(1.75rem, 2.8vw, 3rem);

    /* Sizes and leading follow the corresponding roles on the theme's About page. */
    --page-title-size: clamp(2.375rem, 4.4vw, 4.5rem);
    --copy-size: clamp(1rem, 0.9375rem + 0.25vw, 1.125rem);
    --caption-size: 0.875rem;
    --title-leading: 1.055;
    --section-leading: 1.1;
    --body-leading: 1.5;
    --caption-leading: 1.4;
    font-family: "IBM Plex Sans", sans-serif;
    color: #fff;
    background: var(--ink);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

body,
h1,
h2,
h3,
p,
figure {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
input:focus-visible + span {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.wrap {
    width: 100%;
    max-width: var(--page-max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.eyebrow {
    font-size: var(--caption-size);
    font-weight: 400;
    line-height: var(--caption-leading);
}

h1,
h2,
h3 {
    font-weight: 400;
    line-height: var(--section-leading);
    text-wrap: balance;
}

[hidden] {
    display: none !important;
}


/* ################################################# */
/* 2. Masthead and links */
/* ################################################# */

.skip {
    position: absolute;
    z-index: 4;
    top: 0.5rem;
    left: var(--gutter);
    padding: 0.65rem;
    color: var(--ink);
    background: var(--paper);
    transform: translateY(-170%);
}

.skip:focus {
    transform: none;
}

.masthead,
.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.masthead {
    min-height: 5.3rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.22em;
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 1;
}

.mark {
    width: 0.85em;
    height: 0.74em;
    background: currentColor;
    mask: url("brand-mark.svg") center / contain no-repeat;
}

nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 3rem);
}

.nav-link,
.cutoff,
.underlink {
    display: inline-block;
    font-weight: 500;
}

.nav-link {
    padding-block: 0.65rem;
}

.underlink {
    text-decoration: underline solid var(--accent) 1px;
    text-underline-offset: 6px;
}

.underlink {
    padding-block: 0.5rem;
}

.underlink:not(.izulica-demo-control):hover {
    color: var(--accent);
}


/* ################################################# */
/* 3. Fullscreen opening and accordion */
/* ################################################# */

/* Keep the logo and navigation on a single layer above the opening photograph. */
body > .masthead {
    position: absolute;
    inset: 0 0 auto;
    z-index: 5;
    pointer-events: none;
}

@media screen and (prefers-reduced-motion: no-preference) {
    body > .masthead {
        translate: 0 var(--masthead-scroll-offset, 0px);
    }
}

.masthead :is(.brand, nav) {
    pointer-events: auto;
}

.opening {
    position: relative;
    z-index: 3;
    --opening-columns: 4;
}

.opening-stage {
    position: relative;
    display: grid;
    align-items: end;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--ink);
}

.opening-visual,
#opening-accordion,
#opening-projects,
.opening-stage::after {
    position: absolute;
    inset: 0;
}

.opening-visual {
    overflow: hidden;
}

#opening-accordion {
    width: 100%;
    height: 100%;
    opacity: 0;
    touch-action: pan-y pinch-zoom;
}

/* The native photo strip supports keyboard scrolling and paints before the canvas is ready. */
#opening-projects {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
}

#opening-projects article {
    flex: 0 0 calc(100% / var(--opening-columns));
    min-width: 0;
    overflow: hidden;
}

#opening-projects picture {
    display: block;
    height: 100%;
}

#opening-projects img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(var(--opening-artwork-scale, 1));
}

#opening-projects:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: -4px;
}

.opening-visual.is-interactive #opening-accordion {
    opacity: 1;
}

.izulica-accordion-pending #opening-projects,
.opening-visual.is-interactive #opening-projects {
    opacity: 0;
    pointer-events: none;
}

.opening-visual.has-keyboard-focus #opening-projects {
    opacity: 1;
    pointer-events: auto;
}

.opening-stage::after {
    content: "";
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgb(0 0 0 / 70%), transparent 20%),
        linear-gradient(to top, rgb(0 0 0 / 94%), rgb(0 0 0 / 70%) 16%, transparent 52%);
}

/* Native scrolling supplies the travel. Clipping only this layer leaves the gallery underneath live. */
.opening.has-scroll-cut {
    height: var(--opening-travel);
    pointer-events: none;
}

.has-scroll-cut .opening-stage {
    position: fixed;
    inset: 0 0 auto;
    pointer-events: auto;
    clip-path: inset(0);
}

.opening[data-folded="true"] .opening-stage {
    visibility: hidden;
}

.opening .intro {
    position: relative;
    z-index: 2;
    display: grid;
    /* Reserve the title width and let the detail column reach the masthead gutter. */
    grid-template-columns: fit-content(58%) minmax(0, 1fr);
    gap: clamp(0.625rem, 1vw, 1rem) clamp(2rem, 5vw, 6rem);
    align-items: start;
    padding-block: 9rem clamp(2rem, 4.5vw, 5.5rem);
    pointer-events: none;
}

.opening .intro > .eyebrow {
    grid-column: 1;
    color: #fff;
}

.intro h1 {
    grid-column: 1;
    grid-row: 2;
    max-width: 9.5ch;
    color: var(--accent);
    font-size: clamp(4.5rem, 7.2vw, 8.5rem);
    line-height: 0.99;
    letter-spacing: -0.055em;
}

.intro-detail {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    /* Keep the same measure while the paragraph is split into animated lines. */
    width: min(100%, 40ch);
    font-size: clamp(1.0625rem, 0.94rem + 0.36vw, 1.3125rem);
    line-height: 1.42;
}

@media (width > 48rem) {
    .intro h1,
    .intro-detail {
        align-self: end;
    }

    .intro-detail {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-self: end;
        text-align: end;

        /* Align the demo underline with the ink at the foot of the p in portfolio. */
        padding-block-end: clamp(2px, 0.15vw, 3px);
    }
}

.intro-detail p {
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.intro-detail .underlink {
    margin-top: clamp(0.875rem, 1.25vw, 1.25rem);
    pointer-events: auto;
}

.intro-detail .underlink svg path {
    transform-box: view-box;
    transform-origin: center;
    transform: rotate(0deg);
}

.intro-detail .underlink:is(:hover, :focus-visible) svg path {
    transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
    .intro-detail .underlink svg path {
        transition: transform 320ms cubic-bezier(0.25, 0.1, 0.25, 1);
    }
}

@media (max-width: 1210px) {
    .opening {
        --opening-columns: 3;
    }
}

@media (max-width: 768px) {
    .opening {
        --opening-columns: 1.75;
    }
}

@media (max-width: 48rem) {
    .opening .intro {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
    }

    .intro h1 {
        max-width: 11ch;
        font-size: clamp(3.35rem, 9.5vw, 5rem);
    }

    .intro-detail {
        grid-column: 1;
        grid-row: 3;
        margin-top: 0.25rem;
        font-size: 1.0625rem;
    }

    .opening-stage::after {
        background: linear-gradient(to bottom, rgb(0 0 0 / 65%), transparent 17%),
            linear-gradient(to top, rgb(0 0 0 / 96%), rgb(0 0 0 / 77%) 23%, transparent 60%);
    }
}

@media print {
    body > .masthead,
    .has-scroll-cut .opening-stage {
        position: relative;
    }

    .opening.has-scroll-cut {
        height: auto;
    }

    .opening[data-folded] .opening-stage,
    .opening .opening-stage {
        min-height: 0;
        /* The scroll handler sets the live polygon directly on the opening layer. */
        clip-path: none !important;
        visibility: visible;
    }

    .opening-visual,
    .opening-stage::after {
        display: none;
    }
}


/* ################################################# */
/* 4. Live example grid */
/* ################################################# */

.examples {
    padding-block-start: clamp(1.75rem, 3.2vw, 3.75rem);
}

.section-bar {
    align-items: baseline;
    padding-block-start: clamp(1.75rem, 2.75vw, 3.25rem);
    padding-block-end: var(--section-heading-gap);
}

.section-bar h2 {
    font-size: clamp(2.875rem, 1.9rem + 2.7vw, 5.125rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border: 0;
    margin: 0;
    padding: 0;
}

.filters label {
    position: relative;
    cursor: pointer;
}

.filters input {
    position: absolute;
    opacity: 0;
}

.filters label > span {
    display: block;
    padding: 0.6rem 0.8rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.25;
}

.filters input:checked + span:not(.izulica-demo-control) {
    color: var(--paper);
    text-decoration: underline solid var(--accent) 1px;
    text-underline-offset: 6px;
}

.filters label:hover > span {
    color: var(--paper);
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    /* Align the captions beneath the different sizes of the two opening screenshots. */
    align-items: end;
    row-gap: clamp(2.5rem, 4.25vw, 4rem);
    column-gap: clamp(2rem, 4vw, 4.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.example {
    grid-column: span 6;
}

/* The thumbnail and its title share one keyboard stop. Leave the category and grid gaps outside the hit area. */
.example-preview {
    display: block;
    pointer-events: none;
}

.example-preview :is(.example-image, .example-title) {
    pointer-events: auto;
    cursor: pointer;
}

/* Feature the first visible pair on wide screens. The Pages filter uses equal columns. */
@media (width > 68rem) {
    .example-grid:has(> .project-example:not([hidden])) {
        & > :nth-child(1 of :not([hidden])) {
            grid-column: span 7;
        }

        & > :nth-child(2 of :not([hidden])) {
            grid-column: span 5;
        }
    }
}

/* Keep the complete page capture visible at every card width. */
.example-image {
    overflow: hidden;
}

.example-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Keep the backing on the image so it follows the native-to-canvas handoff. */
.example-image[data-izulica-cutoff-backing] img {
    padding: clamp(12px, 4%, 32px);
    background-color: #292929;
}

.example-caption {
    display: grid;
    row-gap: clamp(0.375rem, 0.45vw, 0.5rem);
    margin-block-start: clamp(0.875rem, 1.25vw, 1.25rem);
}

figcaption {
    color: var(--muted);
    font-size: var(--caption-size);
    line-height: var(--caption-leading);
}

.example-caption p {
    color: var(--muted);
    font-size: clamp(0.9375rem, 0.875rem + 0.15vw, 1rem);
    line-height: var(--caption-leading);
}

.example-title {
    position: relative;
    justify-self: start;
    max-width: 100%;
    font-size: clamp(2rem, 1.4rem + 1.65vw, 3.25rem);
    line-height: var(--section-leading);
    letter-spacing: -0.03em;
}

/* Match the live custom palette's cutoff and lettering on its preview title. */
.example-title-custom-palette {
    --example-title-fill: #e00000;
    --example-title-ink: #fff;
}

/* Wrap the split title between whole words at its natural width. */
.example-title .izulica-word-mask {
    max-width: none;
    white-space: nowrap;
}

/* Native links can still highlight their title before the animated controls are ready. */
.example-preview:is(:focus-visible, :active) .example-title:not(.izulica-demo-control) {
    background: var(--example-title-fill, var(--accent));
    color: var(--example-title-ink, var(--ink));
}

@media (hover: hover) {
    .example-preview:hover .example-title:not(.izulica-demo-control) {
        background: var(--example-title-fill, var(--accent));
        color: var(--example-title-ink, var(--ink));
    }
}


/* ################################################# */
/* 5. Features and footer */
/* ################################################# */

.features {
    --section-cut: clamp(14px, 2.2vw, 36px);
    --feature-row-gap: clamp(2.25rem, 5vw, 5rem);
    --feature-column-gap: clamp(1rem, 1.5vw, 1.75rem);
    --feature-caption-gap: calc(var(--caption-size) * 0.7);
    --feature-muted: #565652;
    position: relative;
    margin-block-start: var(--feature-row-gap);
    border-block: var(--section-cut) solid transparent;
    padding-block: var(--feature-row-gap);
    color: var(--ink);
    isolation: isolate;
    background: #fff padding-box;
}

/* Only the two shallow edges need clipping. The copy and film scroll on a flat background. */
.features::before,
.features::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    height: calc(var(--section-cut) + 1px);
    z-index: -1;
    background: #fff;
    pointer-events: none;
}

.features::before {
    inset-block-start: calc(-1 * var(--section-cut));
    clip-path: polygon(0 var(--section-cut), 100% 0, 100% 100%, 0 100%);
}

.features::after {
    inset-block-end: calc(-1 * var(--section-cut));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 1px);
}

.features .display {
    margin-block-end: var(--examples-heading-gap, var(--section-heading-gap));
    font-size: clamp(3.125rem, 2rem + 3.65vw, 6rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

/* The feature spreads use equal columns. The media changes sides on desktop. */
.feature-spread {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "media copy";
    align-items: center;
    column-gap: clamp(3rem, 6vw, 7rem);
}

.film-feature,
.audio-feature {
    grid-template-areas: "copy media";
}

.feature-spread + .feature-spread,
.feature-notes {
    margin-block-start: clamp(3.5rem, 7vw, 7rem);
}

.feature-media {
    grid-area: media;
    min-width: 0;
    width: 100%;
}

.editor-feature .feature-media {
    align-self: start;
}

.feature-text {
    grid-area: copy;
    min-width: 0;
    width: 100%;
}

/* Center the copy against the picture itself, above the caption baseline. */
@media (width > 56rem) {
    .feature-text {
        padding-block-end: calc(var(--feature-caption-gap) + var(--caption-size) * var(--caption-leading));
    }
}

.feature-media img,
.feature-media video {
    display: block;
    width: 100%;
    height: auto;
}

.feature-media figcaption,
.feature-text .eyebrow {
    color: var(--feature-muted);
    font-size: var(--caption-size);
    line-height: var(--caption-leading);
}

.feature-media figcaption {
    margin-block-start: var(--feature-caption-gap);
}

/* The larger spread titles sit between the section heading and the compact feature list. */
.feature-text h3 {
    margin-block: 0.75rem clamp(1rem, 1.6vw, 1.5rem);
    font-size: clamp(2rem, 1.45rem + 1.85vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.feature-text .eyebrow {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    display: block;
    flex: none;
    width: 1.375rem;
    height: auto;
    color: var(--ink);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linejoin: bevel;
    stroke-linecap: square;
}

:is(.editor-feature, .film-feature, .dashboard-feature) .eyebrow > :is(.feature-icon, .izulica-feature-icon-mask) {
    position: relative;
    top: -2px;
}

.feature-text p:not(.eyebrow),
.feature-notes p {
    color: #353532;
    font-size: var(--copy-size);
    line-height: var(--body-leading);
    text-wrap: pretty;
}

.feature-text p + p {
    margin-block-start: 0.75em;
}

.features .underlink {
    --action-size: var(--copy-size);
    margin-block-start: 1.25rem;
    text-decoration-color: var(--accent);
}

.features .underlink:not(.izulica-demo-control):hover {
    color: var(--ink);
    background: var(--accent);
}

/* These column proportions give the still and film the same rendered height.
   Each caption follows its media so the film's source height cannot expand the row. */
.film-frame {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    column-gap: var(--feature-column-gap);
    row-gap: var(--feature-caption-gap);
    align-items: start;
}

.feature-notes {
    --note-rule-space: clamp(2.375rem, 3.75vw, 3.75rem);
    --note-title-size: clamp(1.75rem, 1.375rem + 0.95vw, 2.5rem);
    --note-icon-size: calc(0.86 * var(--note-title-size));
    --note-icon-gap: clamp(0.625rem, 1vw, 1rem);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--feature-column-gap);
    row-gap: var(--note-rule-space);
}

.feature-notes article {
    --divider-color: #999994;
    --divider-rise: clamp(9px, 1.05vw, 16px);
    --note-rule-height: calc(var(--divider-rise) * var(--divider-scale, 1));
    position: relative;
    padding-block-start: var(--note-rule-space);
}

/* Draw the diagonal within the gutter above the heading. The soft stroke edges
   keep its one-pixel weight even where it crosses between screen pixels. */
.feature-notes article::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: calc(-0.5 * var(--note-rule-height));
    height: var(--note-rule-height);
    background: linear-gradient(
        var(--divider-direction, to top right),
        transparent calc(50% - 1px),
        var(--divider-color) 50%,
        transparent calc(50% + 1px)
    );
    pointer-events: none;
}

.feature-notes article:nth-child(even) {
    --divider-direction: to bottom right;
}

/* Keep the title and copy on the same left edge. The icon aligns with the first line of type. */
.feature-notes h3 {
    display: grid;
    grid-template-columns: var(--note-icon-size) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--note-icon-gap);
    margin-block-end: 0.75rem;
    font-size: var(--note-title-size);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.feature-notes .feature-icon {
    width: var(--note-icon-size);
}

.feature-notes h3 > :first-child {
    margin-block-start: 0.12em;
}

.feature-notes p {
    margin-inline-start: calc(var(--note-icon-size) + var(--note-icon-gap));
}

/* Shared heading tracks align the first line of copy even when a note title wraps. */
@supports (grid-template-rows: subgrid) {
    .feature-notes article {
        display: grid;
        grid-row: span 2;
        grid-template-rows: subgrid;
        row-gap: 0.75rem;
    }

    .feature-notes h3 {
        margin: 0;
    }
}

.footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: last baseline;
    gap: 0.5rem 1rem;
    padding-block: 2rem;
}

/* Align the mark with the visible capitals in the footer wordmark. */
.footer .brand {
    grid-column: 1 / -1;
    justify-self: start;
    align-items: baseline;
}

.footer .mark {
    width: auto;
    height: 1cap;
    aspect-ratio: 46 / 40;
}

.footer-actions {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1.25rem 1.125rem;
}

.footer .underlink {
    font-size: var(--action-size, 0.9375rem);
    white-space: nowrap;
}

.footer p .underlink {
    justify-self: start;
    color: #fff;
}

.footer p {
    color: var(--muted);
    font-size: 0.875rem;
}


/* ################################################# */
/* 6. Responsive layout */
/* ################################################# */

@media (max-width: 68rem) {
    .feature-notes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 56rem) {
    .feature-spread {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "copy" "media";
        row-gap: clamp(1.75rem, 4vw, 2.5rem);
    }

    .editor-feature {
        grid-template-areas: "media" "copy";
    }

    .feature-spread > .feature-media {
        justify-self: start;
    }
}

@media (max-width: 800px) {
    .masthead {
        min-height: 4.4rem;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }

    .example {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    :root {
        --gutter: clamp(14px, 4vw, 20px);
    }
}

@media (max-width: 40rem) {
    .feature-notes {
        grid-template-columns: 1fr;
    }
}

/* The portrait keeps room for its playback controls on a narrow phone. */
@media (max-width: 30rem) {
    .film-frame {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1.5rem;
    }

    .film-frame .wp-block-video {
        width: 72%;
        justify-self: end;
    }
}

@media (max-width: 600px) {
    .footer {
        --action-size: 0.875rem;
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.5rem;
    }

    /* Give the credit and actions separate rows, including room for their hover backgrounds. */
    .footer-actions {
        justify-self: start;
        margin-block-start: 1rem;
    }

    .brand {
        font-size: 1.25rem;
    }

    nav {
        gap: 0.65rem;
        font-size: 0.875rem;
    }

    .section-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .filters label > span {
        padding-inline: 0.5rem;
    }
}
