/* Homepage cinematic layout v4 — keeps original logo and Flask navigation. */
.brand-text small {
    display: block;
    font-size: .58rem;
    font-weight: 500;
    letter-spacing: .015em;
    color: var(--muted);
    margin-top: 2px
}

.site-header .bar {
    max-width: 1540px
}

.site-header .nav {
    gap: clamp(9px, 1.3vw, 24px)
}

.site-header .nav a {
    font-size: .83rem
}

.header-start-v4 {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 11px 17px;
    background: #08644c;
    color: #fff !important;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 750;
    text-decoration: none
}

.header-start-v4:hover {
    background: #094c3b
}

.theme-switch-v4 {
    width: 67px !important;
    min-width: 67px;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    gap: 0;
    border: 1px solid #d2d8cd !important;
    background: linear-gradient(90deg, #fff8e8, #174b40) !important
}

.theme-switch-v4 .sun {
    color: #e4a100 !important
}

.theme-switch-v4 .moon {
    color: white !important;
    display: inline !important
}

.theme-switch-v4:focus-visible {
    outline: 3px solid #e9ad46;
    outline-offset: 3px
}

main.wrap>.hero-v4 {
    margin: 16px calc(min(0px, (1200px - 100vw)/2)) 44px;
    max-width: none
}

.hero-v4 {
    position: relative;
    min-height: 510px;
    border-radius: 25px;
    overflow: hidden;
    background: #d8e5df;
    isolation: isolate;
    display: grid;
    grid-template-columns: 42% 58%;
    align-items: stretch;
    border: 1px solid rgba(13, 66, 55, .12)
}

.hero-v4-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f9faf7 0%, rgba(250, 250, 246, .97) 27%, rgba(250, 250, 246, .7) 43%, transparent 67%), url('../img/hero-construction.webp') center/cover;
    z-index: -1
}

.hero-v4-copy {
    padding: clamp(28px, 4vw, 60px) 0 clamp(30px, 4vw, 60px) clamp(26px, 4vw, 58px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 3
}

.hero-v4-eyebrow {
    background: #e6f3ed;
    color: #07523f;
    border-radius: 999px;
    padding: 10px 14px;
    width: max-content;
    font-size: .69rem;
    letter-spacing: .06em
}

.hero-v4 h1 {
    font-size: clamp(3rem, 4.9vw, 5.4rem);
    letter-spacing: -.06em;
    line-height: 1.05;
    max-width: 11ch;
    margin: 24px 0 20px;
    color: #092a2d
}

.hero-v4 h1 em {
    font-style: normal;
    color: #08684f
}

.hero-v4 .lead {
    max-width: 35ch;
    color: #375457;
    font-size: clamp(.95rem, 1.35vw, 1.16rem);
    line-height: 1.65
}

.hero-v4-form {
    display: flex;
    align-items: center;
    gap: 9px;
    background: white;
    padding: 8px 8px 8px 17px;
    border-radius: 15px;
    box-shadow: 0 12px 30px rgba(24, 52, 49, .12);
    width: min(540px, 112%);
    margin-top: 22px;
    min-width: 0
}

.hero-v4-form>span {
    color: #e3a11a;
    font-size: 1.4rem
}

.hero-v4-form input {
    min-width: 0;
    flex: 1;
    border: 0;
    background: transparent;
    outline: 0;
    font: inherit;
    font-size: .84rem;
    color: #183b3c
}

.hero-v4-form button {
    background: #08644c;
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer
}

.hero-v4-form button:hover {
    background: #074c3b;
    transform: translateY(-1px)
}

.hero-v4-trust {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 22px;
    font-size: .7rem;
    color: #365456
}

.hero-v4-experience {
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px 22px 16px 0
}

.hero-v4-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1
}

.hero-v4-scene>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.06);
    transition: filter 1s, transform 2.2s
}

.hero-v4-scene-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(237, 244, 239, .1), transparent 45%), linear-gradient(0deg, rgba(0, 29, 25, .4), transparent 42%)
}

.hero-v4-blueprint {
    position: absolute;
    inset: 15% 10%;
    opacity: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 36px, rgba(103, 239, 201, .65) 37px), repeating-linear-gradient(90deg, transparent 0 36px, rgba(103, 239, 201, .65) 37px);
    transform: perspective(480px) rotateX(25deg);
    transition: opacity .8s
}

.hero-v4-experience[data-step="0"] .hero-v4-blueprint,
.hero-v4-experience[data-step="1"] .hero-v4-blueprint {
    opacity: .75
}

.hero-v4-experience[data-step="0"] .hero-v4-scene>img {
    filter: grayscale(.8) brightness(.75)
}

.hero-v4-experience[data-step="1"] .hero-v4-scene>img {
    filter: grayscale(.55)
}

.hero-v4-experience[data-step="2"] .hero-v4-scene>img {
    filter: saturate(.65)
}

.hero-v4-experience[data-step="3"] .hero-v4-scene>img {
    filter: saturate(.85)
}

.hero-v4-experience[data-step="4"] .hero-v4-scene>img {
    filter: saturate(1.1)
}

.hero-v4-experience[data-step="5"] .hero-v4-scene>img {
    filter: saturate(1.3) contrast(1.08)
}

.hero-v4-stage-menu {
    position: absolute;
    top: 58px;
    left: 12px;
    z-index: 2;
    display: grid;
    gap: 7px
}

.hero-v4-stage-menu button {
    display: flex;
    align-items: center;
    gap: 11px;
    background: rgba(247, 250, 249, .86);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 999px;
    padding: 6px 16px 6px 7px;
    min-width: 135px;
    text-align: left;
    color: #163e3c;
    font-size: .78rem;
    cursor: pointer;
    backdrop-filter: blur(10px)
}

.hero-v4-stage-menu button span {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
    font-weight: 800
}

.hero-v4-stage-menu button.active {
    background: #096c51;
    color: white
}

.hero-v4-stage-menu button.active span {
    color: #075f4a
}

.hero-v4-play {
    position: absolute;
    right: 18px;
    top: 26px;
    z-index: 3;
    background: rgba(6, 36, 36, .8);
    color: #fff;
    border: 1px solid #ffffff70;
    border-radius: 12px;
    padding: 11px 14px;
    cursor: pointer;
    font-size: .78rem
}

.hero-v4-stage-badge {
    position: absolute;
    right: 18px;
    bottom: 130px;
    z-index: 2;
    color: #fff;
    font-weight: 800;
    text-shadow: 0 2px 8px #001
}

.hero-v4-thumbs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 10px;
    background: rgba(250, 250, 249, .87);
    backdrop-filter: blur(14px);
    border-radius: 14px
}

.hero-v4-thumbs button {
    min-width: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: #143b36;
    font-size: .64rem;
    font-weight: 700
}

.hero-v4-thumbs button.active {
    border-color: #087657;
    background: #e2f1e9
}

.thumb-photo {
    display: block;
    aspect-ratio: 1.35;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 5px
}

.thumb-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter .5s
}

.hero-v4-thumbs button:nth-child(1) img {
    filter: grayscale(1) brightness(.8)
}

.hero-v4-thumbs button:nth-child(2) img {
    filter: sepia(.65)
}

.hero-v4-thumbs button:nth-child(3) img {
    filter: saturate(.6)
}

.hero-v4-thumbs button:nth-child(4) img {
    filter: saturate(.8)
}

.hero-v4-progress {
    position: relative;
    z-index: 2;
    height: 3px;
    background: #ffffff55;
    margin: 7px 10px 0;
    border-radius: 5px;
    overflow: hidden
}

.hero-v4-progress span {
    display: block;
    height: 100%;
    width: 16.66%;
    background: #a7f1c9;
    transition: width .4s
}

.tools-v4-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px
}

.tools-v4-heading>div>span {
    font-size: .68rem;
    letter-spacing: .12em;
    color: #087657;
    font-weight: 750
}

.tools-v4-heading h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    letter-spacing: -.05em;
    line-height: 1.15;
    margin: 6px 0
}

.tools-v4-heading>p {
    font-family: cursive;
    font-size: 1.5rem;
    color: #196452;
    transform: rotate(-6deg)
}

.tools-v4 .premium-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px
}

.tools-v4 .premium-feature {
    border-radius: 17px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(10, 49, 41, .08);
    text-decoration: none
}

.tools-v4 .premium-feature-image {
    height: clamp(155px, 16vw, 235px)
}

.tools-v4 .premium-feature .txt {
    min-height: 102px
}

.tools-v4 .premium-feature .txt h3 {
    font-size: 1rem
}

.tools-v4 .premium-feature .txt p {
    font-size: .78rem
}

.tools-v4 .premium-feature:hover {
    border-color: #6caf94
}

.tools-v4 .premium-feature:focus-visible {
    outline: 3px solid #087657;
    outline-offset: 4px
}

[data-theme="dark"] .hero-v4-backdrop {
    background: linear-gradient(90deg, #102b2a 0%, rgba(16, 43, 42, .96) 30%, rgba(16, 43, 42, .6) 48%, transparent 70%), url('../img/hero-construction.webp') center/cover
}

[data-theme="dark"] .hero-v4 h1 {
    color: #f1faf4
}

[data-theme="dark"] .hero-v4 .lead,
[data-theme="dark"] .hero-v4-trust {
    color: #d6e6de
}

[data-theme="dark"] .hero-v4-eyebrow {
    background: #1e5947;
    color: #e0f6e9
}

[data-theme="dark"] .hero-v4-form {
    background: #1e3432
}

[data-theme="dark"] .hero-v4-form input {
    color: #fff
}

[data-theme="dark"] .hero-v4-form input::placeholder {
    color: #c1d0cb
}

@media(max-width:1100px) {
    .site-header .nav a:nth-child(n+4) {
        display: none
    }

    .hero-v4 {
        grid-template-columns: 45% 55%
    }

    .hero-v4-stage-menu {
        top: 70px
    }

    .hero-v4-form {
        width: 105%
    }

    .tools-v4 .premium-features {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:750px) {
    .header-start-v4 {
        display: none
    }

    .hero-v4 {
        display: flex;
        flex-direction: column;
        min-height: 0
    }

    .hero-v4-backdrop {
        background: #f5f8f4
    }

    .hero-v4-copy {
        padding: 30px 22px
    }

    .hero-v4 h1 {
        font-size: clamp(2.7rem, 9vw, 4.2rem)
    }

    .hero-v4-form {
        width: 100%
    }

    .hero-v4-experience {
        min-height: 380px;
        padding: 210px 12px 12px
    }

    .hero-v4-stage-menu {
        top: 15px;
        left: 12px;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px
    }

    .hero-v4-stage-menu button {
        min-width: 0;
        padding: 4px 9px 4px 4px;
        font-size: .65rem
    }

    .hero-v4-stage-menu button span {
        width: 21px;
        height: 21px
    }

    .hero-v4-play {
        right: 12px;
        top: 15px;
        font-size: .7rem
    }

    .hero-v4-stage-badge {
        bottom: 110px
    }

    .hero-v4-thumbs {
        gap: 2px;
        padding: 6px
    }

    .hero-v4-thumbs button {
        font-size: .55rem;
        padding: 2px
    }

    .tools-v4-heading>p {
        display: none
    }

    [data-theme="dark"] .hero-v4-backdrop {
        background: #102b2a
    }
}

@media(max-width:420px) {
    .hero-v4-form {
        flex-wrap: wrap
    }

    .hero-v4-form input {
        flex-basis: calc(100% - 42px)
    }

    .hero-v4-form button {
        width: 100%
    }

    .hero-v4-experience {
        min-height: 390px;
        padding-top: 240px
    }

    .hero-v4-stage-menu {
        top: 12px
    }

    .hero-v4-play {
        top: 98px
    }

    .hero-v4-thumbs button {
        font-size: .48rem
    }

    .tools-v4 .premium-features {
        grid-template-columns: 1fr
    }
}

@media(prefers-reduced-motion:reduce) {

    .hero-v4-scene>img,
    .thumb-photo img {
        transition: none !important
    }
}

/* Genuine geometry-based construction preview: photo is retained as the default. */
.construction-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s
}

.show-3d .construction-canvas {
    opacity: 1
}

.show-3d .hero-v4-blueprint,
.show-3d .hero-v4-scene-shade {
    opacity: 0 !important
}

.hero-v4-3d {
    position: absolute;
    top: 76px;
    right: 18px;
    z-index: 5;
    border: 1px solid #fff9;
    background: #07563fe8;
    color: white;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 700;
    cursor: pointer
}

.hero-v4-3d:hover,
.hero-v4-3d:focus-visible {
    background: #087c5a;
    outline: 2px solid #fff;
    outline-offset: 2px
}

.hero-v4-stage-menu,
.hero-v4-play,
.hero-v4-stage-badge {
    z-index: 6
}

.hero-v4-thumbs {
    z-index: 7
}

@media(max-width:750px) {
    .hero-v4-3d {
        top: 65px;
        right: 12px;
        font-size: .72rem
    }

    .hero-v4-play {
        top: 108px
    }
}

@media(max-width:420px) {
    .hero-v4-3d {
        top: 104px
    }

    .hero-v4-play {
        top: 145px
    }
}