/* ==========================================================================
   Flowiee — flow.css
   Shared awwwards-layer styles: preloader, cursor, transitions, reveals,
   marquee, work index, fluid line. Palette: forest / sage / cream.
   ========================================================================== */

:root {
    --flow-forest: #18442A;
    --flow-sage: #45644A;
    --flow-cream: #E4DBC4;
    --flow-off: #F3EDE3;
    --flow-ease: cubic-bezier(0.76, 0, 0.24, 1);
}

/* --------------------------------------------------------------------------
   Global Selection & Scrollbar
   -------------------------------------------------------------------------- */
::selection {
    background: var(--flow-forest);
    color: var(--flow-cream);
}

::-moz-selection {
    background: var(--flow-forest);
    color: var(--flow-cream);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--flow-off);
}

::-webkit-scrollbar-thumb {
    background: var(--flow-forest);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--flow-sage);
}

/* --------------------------------------------------------------------------
   Lenis smooth scroll (recommended base styles)
   -------------------------------------------------------------------------- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Initial states — only applied once flow.js has confirmed it can animate
   (html.flow-anim). No JS, or a failed CDN, means a fully visible page.
   -------------------------------------------------------------------------- */
html.flow-anim [data-reveal],
html.flow-anim [data-hero],
html.flow-anim [data-reveal-group] > * {
    opacity: 0;
}

html.flow-anim [data-scrub-words] {
    opacity: 0;
}

/* --------------------------------------------------------------------------
   Grain overlay — subtle film texture over the cream canvas
   -------------------------------------------------------------------------- */
.flow-grain {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

/* --------------------------------------------------------------------------
   Preloader
   -------------------------------------------------------------------------- */
.flow-preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--flow-forest);
    color: var(--flow-off);
    display: flex;
    align-items: center;
    justify-content: center;
    /* No-JS / failed-JS fallback: quietly remove itself */
    animation: flowPreloaderFallback 0.8s ease 5s forwards;
}

html:not(.js) .flow-preloader {
    display: none;
}

@keyframes flowPreloaderFallback {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.flow-preloader__logo {
    display: flex;
    overflow: hidden;
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.5rem, 11vw, 8rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    opacity: 0;
}

.flow-preloader__logo .pl-char {
    display: inline-block;
    will-change: transform;
}

.flow-preloader__logo .pl-char.is-italic {
    font-style: italic;
    color: var(--flow-cream);
}

.flow-preloader__tag {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18vh;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: rgba(228, 219, 196, 0.5);
    opacity: 0;
}

.flow-preloader__count {
    position: absolute;
    right: clamp(1.5rem, 5vw, 4rem);
    bottom: clamp(1.25rem, 4vw, 3rem);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(2rem, 6vw, 4rem);
    color: rgba(228, 219, 196, 0.65);
    opacity: 0;
}

/* --------------------------------------------------------------------------
   Page transition overlay
   -------------------------------------------------------------------------- */
.flow-transition {
    position: fixed;
    inset: 0;
    z-index: 190;
    pointer-events: none;
    visibility: hidden;
}

.flow-transition.is-active {
    visibility: visible;
    pointer-events: all;
}

.flow-transition__panel {
    position: absolute;
    inset: -2% 0;
    background: var(--flow-forest);
    transform: translateY(112%);
    will-change: transform;
}

/* Curved edges that lead/trail the wipes for a softer, liquid feel */
.flow-preloader::after,
.flow-transition__panel::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -5%;
    width: 110%;
    height: 9vh;
    background: var(--flow-forest);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.flow-transition__panel::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -5%;
    width: 110%;
    height: 9vh;
    background: var(--flow-forest);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.flow-transition__brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--flow-off);
    opacity: 0;
}

/* --------------------------------------------------------------------------
   Custom cursor
   -------------------------------------------------------------------------- */
html.flow-cursor,
html.flow-cursor * {
    cursor: none !important;
}

.flow-cursor-dot,
.flow-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 220;
    pointer-events: none;
    border-radius: 50%;
    will-change: transform;
}

.flow-cursor-dot {
    width: 30px;
    height: 30px;
    margin: -5px 0 0 -6px;
    background: var(--flow-forest);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 5 L6 25 L14 17 L24 17 Z' fill='black' stroke='black' stroke-width='4' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 5 L6 25 L14 17 L24 17 Z' fill='black' stroke='black' stroke-width='4' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    border-radius: 0;
}

.flow-cursor-ring {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        width 0.35s var(--flow-ease),
        height 0.35s var(--flow-ease),
        margin 0.35s var(--flow-ease),
        background-color 0.35s ease,
        border-color 0.35s ease;
}

.flow-cursor-ring.is-active {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-color: transparent;
}

.flow-cursor-ring.is-label {
    width: 88px;
    height: 88px;
    margin: -44px 0 0 -44px;
    background: var(--flow-forest);
    border-color: var(--flow-forest);
}

.flow-cursor-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--flow-off);
    opacity: 0;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}

.flow-cursor-ring.is-label .flow-cursor-label {
    opacity: 1;
}

.flow-cursor-ring.is-hidden,
.flow-cursor-dot.is-hidden {
    opacity: 0;
}

/* Suppressed while the showcase flower cursor is active */
.flow-cursor-dot.is-suppressed,
.flow-cursor-ring.is-suppressed {
    opacity: 0 !important;
}

/* --------------------------------------------------------------------------
   Showcase flower cursor — scalloped badge with a spinning word ring,
   shown over surfaces marked data-cursor-flower (work cards, project index)
   -------------------------------------------------------------------------- */
.flow-cursor-flower {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 219;
    width: 170px;
    height: 170px;
    margin: -85px 0 0 -85px;
    pointer-events: none;
    will-change: transform;
}

.flow-cursor-flower__inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.4);
    /* Exit is fast so the badge never trails into neighbouring sections */
    transition:
        opacity 0.15s ease,
        transform 0.2s ease;
}

.flow-cursor-flower.is-active .flow-cursor-flower__inner {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity 0.3s ease,
        transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.flow-cursor-flower__ring {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    animation: flowCursorSpin 10s linear infinite;
    filter: drop-shadow(0 1px 3px rgba(24, 68, 42, 0.45));
}

.flow-cursor-flower__ring text {
    fill: var(--flow-off);
    font-family: 'Inter', sans-serif;
}

.flow-cursor-flower__core {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--flow-forest);
}

.flow-cursor-flower__petals {
    position: absolute;
    inset: 0;
}

.flow-cursor-flower__petals circle {
    fill: var(--flow-cream);
}

.flow-cursor-flower__arrow {
    position: relative;
    width: 34px;
    height: 34px;
}

@keyframes flowCursorSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Inverted cursor over dark surfaces (footer, forest panels, hovered rows) */
.flow-cursor-dot.is-inverted {
    background: var(--flow-cream);
}

.flow-cursor-ring.is-inverted {
    border-color: transparent;
}

.flow-cursor-ring.is-inverted.is-label {
    background: var(--flow-cream);
    border-color: var(--flow-cream);
}

.flow-cursor-ring.is-inverted .flow-cursor-label {
    color: var(--flow-forest);
}

/* --------------------------------------------------------------------------
   Header nav: sliding pill highlight
   -------------------------------------------------------------------------- */
.has-nav-pill {
    position: relative;
}

.has-nav-pill a {
    position: relative;
    z-index: 1;
}

.nav-pill {
    position: absolute;
    left: 0;
    top: -9px;
    bottom: -9px;
    width: 0;
    border-radius: 999px;
    background: var(--flow-cream);
    opacity: 0;
    pointer-events: none;
    will-change: transform, width;
}

/* --------------------------------------------------------------------------
   Hero details
   -------------------------------------------------------------------------- */
.flow-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.flow-scroll-line {
    display: block;
    width: 1.5px;
    height: 52px;
    background: rgba(24, 68, 42, 0.28);
    position: relative;
    overflow: hidden;
}

.flow-scroll-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--flow-sage);
    transform-origin: top;
    animation: flowScrollLine 2.2s var(--flow-ease) infinite;
}

@keyframes flowScrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    45% {
        transform: scaleY(1);
        transform-origin: top;
    }

    55% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.flows-word {
    position: relative;
    display: inline-block;
}

.flows-word svg {
    position: absolute;
    left: -4%;
    bottom: -0.12em;
    width: 108%;
    height: 0.28em;
    overflow: visible;
    pointer-events: none;
}

.flows-word svg path {
    stroke: var(--flow-sage);
    stroke-width: 3;
    stroke-linecap: round;
    fill: none;
    vector-effect: non-scaling-stroke;
}

/* --------------------------------------------------------------------------
   SplitText line masks
   -------------------------------------------------------------------------- */
.split-line {
    will-change: transform;
}

/* --------------------------------------------------------------------------
   Fluid line — drawn down the page on scroll (desktop only)
   -------------------------------------------------------------------------- */
.flow-line-wrap {
    position: relative;
}

.flow-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.flow-line path {
    stroke: var(--flow-sage);
    stroke-width: 1.5;
    stroke-linecap: round;
    fill: none;
    opacity: 0.4;
    vector-effect: non-scaling-stroke;
}

@media (max-width: 767px) {
    .flow-line {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Media reveals & parallax
   -------------------------------------------------------------------------- */
[data-clip] {
    will-change: clip-path;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

[data-clip] img {
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

[data-parallax] {
    will-change: transform;
    transform: scale(1.18);
}

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */
.flow-marquee {
    overflow: hidden;
    white-space: nowrap;
}

.flow-marquee__track {
    display: inline-flex;
    will-change: transform;
    padding: 15px 0;
}

.flow-marquee__group {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: clamp(3rem, 7vw, 7rem);
    padding-right: clamp(3rem, 7vw, 7rem);
}

/* --------------------------------------------------------------------------
   Services — pinned horizontal scroll
   -------------------------------------------------------------------------- */
.services-pin {
    position: relative;
    overflow: hidden;
}

.services-track {
    display: flex;
    align-items: stretch;
    gap: clamp(1.5rem, 3vw, 3rem);
    padding: 0 6vw;
    will-change: transform;
}

.service-panel {
    position: relative;
    flex-shrink: 0;
    width: min(620px, 70vw);
    min-height: min(62vh, 540px);
    border-radius: 1.5rem;
    padding: clamp(2rem, 4vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
               box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px -15px rgba(24, 68, 42, 0.12);
}

.service-panel__ghost {
    position: absolute;
    top: -0.16em;
    right: -0.04em;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(9rem, 17vw, 15rem);
    line-height: 1;
    color: rgba(24, 68, 42, 0.07);
    pointer-events: none;
    user-select: none;
    will-change: transform;
}

.service-panel--cta {
    background: var(--flow-forest);
}

.service-panel--cta .service-panel__ghost {
    color: rgba(228, 219, 196, 0.08);
}

.services-progress {
    position: absolute;
    left: 6vw;
    right: 6vw;
    bottom: 7vh;
    height: 1px;
    background: rgba(24, 68, 42, 0.12);
}

.services-progress__bar {
    height: 100%;
    background: var(--flow-sage);
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

@media (min-width: 768px) {
    .services-pin {
        height: 100vh;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 767px) {
    .services-track {
        flex-direction: column;
        padding: 0 1.5rem;
        gap: 1.5rem;
    }

    .service-panel {
        width: 100%;
        min-height: 0;
    }

    .service-panel__ghost {
        font-size: clamp(5.5rem, 26vw, 8rem);
    }

    .services-progress {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Work index rows
   -------------------------------------------------------------------------- */
.work-row {
    position: relative;
    display: grid;
    grid-template-columns: 3.5rem 1fr auto 2.5rem;
    align-items: center;
    gap: 1.5rem;
    padding: 2.25rem 1.25rem;
    border-bottom: 1px solid rgba(24, 68, 42, 0.12);
    overflow: hidden;
    text-decoration: none;
}

.work-row:first-child {
    border-top: 1px solid rgba(24, 68, 42, 0.12);
}

.work-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--flow-forest);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.work-row:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.work-row > * {
    position: relative;
    z-index: 1;
    transition: color 0.5s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.work-row__num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: rgba(69, 100, 74, 0.7);
}

.work-row__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    line-height: 1.15;
    color: var(--flow-forest);
}

.work-row__meta {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(69, 100, 74, 0.7);
}

.work-row__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--flow-forest);
}

.work-row__arrow svg {
    width: 1.4rem;
    height: 1.4rem;
    transition: transform 0.5s var(--flow-ease);
}

.work-row:hover .work-row__num,
.work-row:hover .work-row__meta {
    color: rgba(228, 219, 196, 0.7);
}

.work-row:hover .work-row__title {
    color: var(--flow-off);
    transform: translateX(14px);
}

.work-row:hover .work-row__arrow {
    color: var(--flow-cream);
}

.work-row:hover .work-row__arrow svg {
    transform: translate(5px, -5px);
}

@media (max-width: 640px) {
    .work-row {
        grid-template-columns: 2.5rem 1fr 2rem;
        padding: 1.75rem 0.75rem;
    }

    .work-row__meta {
        grid-column: 2;
        grid-row: 2;
    }
}

/* The index container clips the floating preview to the section */
.work-index {
    position: relative;
    /* overflow: clip; removed so preview cards aren't cut at the top */
}

/* Floating preview that follows the cursor, bounded to .work-index */
.work-preview {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    width: min(24rem, 28vw);
    border-radius: 0.75rem;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    will-change: transform;
    box-shadow: 0 30px 60px -15px rgba(24, 68, 42, 0.35);
}

.work-preview img, .work-preview video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

/* --------------------------------------------------------------------------
   Footer extras
   -------------------------------------------------------------------------- */
.flow-marquee--footer .flow-marquee__group span {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.2;
    color: rgba(228, 219, 196, 0.14);
}

.flow-marquee--footer .flow-marquee__group .fm-dot {
    font-style: normal;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(228, 219, 196, 0.25);
}

/* --------------------------------------------------------------------------
   Reduced motion — show everything, animate nothing
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    html.flow-anim [data-reveal],
    html.flow-anim [data-hero],
    html.flow-anim [data-reveal-group] > *,
    html.flow-anim [data-scrub-words] {
        opacity: 1 !important;
    }

    .flow-preloader {
        animation-delay: 0.2s;
        animation-duration: 0.3s;
    }

    .flow-scroll-line::after {
        animation: none;
        transform: scaleY(1);
    }

    [data-parallax] {
        transform: none;
    }
}
