/* ==========================================================================
   Vizclay — landing page, portfolio and motion system (loaded with assets/js/motion.js)
   Rule: nothing is hidden unless JS is running (html.js); reduced-motion gets instant states.
   ========================================================================== */

/* ---- Reveal primitives ---- */
html.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js.reduce-motion .reveal { opacity: 1; transform: none; transition: none; }

/* Masked word reveal for headlines */
.is-split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.is-split .w > span { display: inline-block; transform: translateY(110%); animation: vz-rise .9s var(--ease) forwards; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
html.reduce-motion .is-split .w > span { animation: none; transform: none; }
@keyframes vz-rise { to { transform: translateY(0); } }

/* ---- Hero ---- */
.lp-hero { position: relative; background: var(--navy); color: var(--white); overflow: hidden; isolation: isolate; }
.lp-tiles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lp-hero-inner {
	position: relative; z-index: 1;
	display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 96px); align-items: center;
	min-height: clamp(560px, 82vh, 840px); padding-block: clamp(56px, 8vw, 96px);
}
.lp-hero .eyebrow { color: var(--sky); }
.lp-title { font-size: clamp(42px, 6.2vw, 78px); font-weight: 900; line-height: .98; letter-spacing: -.02em; margin: 0 0 24px; max-width: 12ch; }
.lp-text { font-size: clamp(18px, 1.5vw, 21px); color: var(--sky-2); max-width: 48ch; margin: 0; }
.lp-hero .btn-row { margin-top: 32px; }

.lp-hero-media { position: relative; transform-style: preserve-3d; will-change: transform; }
.lp-frame { position: absolute; inset: 7% -6% -7% 8%; background: var(--orange); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); transform: translateZ(-40px); }
html.js .lp-frame { transform: translateZ(-40px) scaleY(0); transform-origin: bottom; animation: vz-frame 1.1s var(--ease) .3s forwards; }
html.reduce-motion .lp-frame { animation: none; transform: translateZ(-40px); }
@keyframes vz-frame { to { transform: translateZ(-40px) scaleY(1); } }
.lp-hero-project { position: relative; display: block; color: var(--white); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); background: var(--navy-2); }
html.js .lp-hero-project { clip-path: polygon(8% 0, 100% 0, 92% 0, 0 0); animation: vz-unveil 1.2s var(--ease) .55s forwards; }
html.reduce-motion .lp-hero-project { animation: none; clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
@keyframes vz-unveil { to { clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); } }
.lp-kenburns { display: block; overflow: hidden; }
.lp-kenburns img, .lp-hero-project .thumb-placeholder { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; display: block; }
.lp-kenburns img { transform: scale(1); animation: vz-kenburns 18s ease-in-out infinite alternate; }
html.reduce-motion .lp-kenburns img { animation: none; }
@keyframes vz-kenburns { to { transform: scale(1.08) translate(-1.5%, 1%); } }
.lp-hero-project.is-empty { aspect-ratio: 3 / 4; display: grid; place-items: center; color: var(--sky); }
.lp-hero-project.is-empty .site-mark { width: 30%; }
.lp-hero-caption {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 14% 24px;
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 18px;
	background: linear-gradient(transparent, rgba(11, 39, 59, .9));
}
.lp-hero-caption .eyebrow { width: 100%; margin: 0; font-size: 12px; }
.lp-hero-caption .icon { margin-left: auto; transition: transform .3s var(--ease); }
.lp-hero-project:hover .lp-hero-caption .icon { transform: translateX(6px); }
.lp-mark { position: absolute; left: -6%; bottom: 6%; width: clamp(64px, 8vw, 104px); aspect-ratio: 183 / 185; color: var(--orange); transform: translateZ(30px); }
.lp-mark span { position: absolute; width: 60%; height: 27%; background: var(--sky); clip-path: polygon(0 100%, 20% 0, 100% 0, 80% 100%); }
.lp-mark-a { left: 40%; top: 0; }
.lp-mark-b { left: 0; top: 38%; }
html.js .lp-mark span { opacity: 0; transform: translate(-30px, 30px); animation: vz-mark .8s var(--ease) forwards; }
html.js .lp-mark-a { animation-delay: 1.1s; }
html.js .lp-mark-b { animation-delay: 1.3s; }
html.reduce-motion .lp-mark span { animation: none; opacity: 1; transform: none; }
@keyframes vz-mark { to { opacity: 1; transform: none; } }

.lp-scroll { position: absolute; left: 50%; bottom: 22px; z-index: 1; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255, 255, 255, .35); border-radius: 14px; }
.lp-scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--orange); animation: vz-scroll 1.8s ease-in-out infinite; }
html.reduce-motion .lp-scroll span { animation: none; }
@keyframes vz-scroll { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 900px) {
	.lp-hero-inner { grid-template-columns: 1fr; min-height: 0; }
	.lp-hero-media { max-width: 420px; margin-top: 16px; }
	.lp-scroll { display: none; }
}

/* ---- Marquee ---- */
.marquee { overflow: hidden; background: var(--orange); color: var(--white); padding-block: 14px; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: vz-marquee 32s linear infinite; }
.marquee:hover .marquee-track, html.reduce-motion .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 16px; font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.marquee-item .site-mark { width: 18px; color: var(--navy); }
@keyframes vz-marquee { to { transform: translateX(-50%); } }

/* ---- Intro statement + stats ---- */
.lp-intro-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.lp-statement { font-size: clamp(24px, 2.6vw, 36px); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; margin: 0; text-wrap: pretty; }
.lp-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.lp-stats li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.lp-stats li:last-child { border-bottom: 1px solid var(--rule); }
.lp-stats strong { font-size: clamp(40px, 4.4vw, 60px); font-weight: 900; line-height: 1; color: var(--orange); font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.lp-stats span { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
@media (max-width: 800px) { .lp-intro-inner { grid-template-columns: 1fr; } }

/* ---- Selected work: editorial rows with parallax imagery ---- */
.lp-work-rows { display: grid; gap: clamp(48px, 8vw, 120px); }
.work-row { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.work-row:nth-child(even) .work-media { order: 2; }
.work-media { display: block; overflow: hidden; clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%); background: var(--sky-2); }
.work-media img, .work-media .thumb-placeholder { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; will-change: transform; }
html.reduce-motion .work-media img { transform: none !important; }
.work-title { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.02; margin: 0 0 14px; }
.work-title a { color: var(--ink); }
.work-title a:hover { color: var(--orange); }
.work-text { font-size: 17px; color: var(--ink-2); margin: 0 0 20px; max-width: 42ch; }
@media (max-width: 800px) { .work-row { grid-template-columns: 1fr; } .work-row:nth-child(even) .work-media { order: 0; } }

/* ---- Courses band ---- */
.lp-courses { background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.lp-courses::before {
	content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06;
	background: url('../img/pattern.svg') 0 0 / 183px 101px; animation: vz-drift 60s linear infinite;
}
html.reduce-motion .lp-courses::before { animation: none; }
@keyframes vz-drift { to { background-position: 366px 202px; } }
.lp-courses .container { position: relative; }
.lp-courses .section-text { color: var(--sky-2); }
.lp-courses .btn-link { color: var(--white); }
.lp-courses .woocommerce-loop-product__title a, .lp-courses .price { color: var(--white); }
.lp-courses .product-card-kind, .lp-courses .product-card-meta { color: var(--sky); }
.lp-courses .product-card-media { background: var(--navy-2); }

/* Product cards: hover lift + play pulse (all grids) */
li.product .product-card-media { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
li.product:hover .product-card-media { transform: translateY(-6px); box-shadow: var(--shadow); }
li.product:hover .play-badge .icon { animation: vz-pulse 1.2s ease-out infinite; }
html.reduce-motion li.product:hover .play-badge .icon { animation: none; }
@keyframes vz-pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 78, 34, .5); } 100% { box-shadow: 0 0 0 18px rgba(240, 78, 34, 0); } }

/* ---- 3D models: rotating step object ---- */
.lp-models { background: var(--sky-3); }
.lp-models-inner { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-bottom: clamp(28px, 4vw, 44px); }
.lp-models .section-head { margin-bottom: 0; }
.lp-object { width: 260px; aspect-ratio: 1; display: grid; place-items: center; perspective: 900px; }
.lp-object-spin { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; animation: vz-spin 14s linear infinite; }
html.reduce-motion .lp-object-spin { animation: none; transform: rotateX(-24deg) rotateY(30deg); }
@keyframes vz-spin { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }
.lp-slab { position: absolute; left: 0; top: 0; width: 170px; height: 62px; background: var(--orange); clip-path: polygon(0 100%, 18% 0, 100% 0, 82% 100%); }
.lp-slab:nth-child(1) { transform: translateZ(60px) translateY(10px); }
.lp-slab:nth-child(2) { transform: rotateY(90deg) translateZ(60px) translateY(46px); background: var(--orange-2); }
.lp-slab:nth-child(3) { transform: rotateY(180deg) translateZ(60px) translateY(82px); background: var(--navy); }
.lp-slab:nth-child(4) { transform: rotateY(270deg) translateZ(60px) translateY(118px); background: var(--navy-3); }
@media (max-width: 800px) { .lp-models-inner { grid-template-columns: 1fr; } .lp-object { width: 200px; margin-inline: auto; } }

/* ---- Process: a line that draws itself ---- */
.process-line { color: var(--orange); margin: -8px 0 12px; }
.process-line svg { width: 100%; height: 48px; display: block; }
.process-path { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.process-line.is-in .process-path, html:not(.js) .process-path, html.reduce-motion .process-path { animation: vz-draw 1.8s var(--ease) forwards; }
html:not(.js) .process-path, html.reduce-motion .process-path { animation: none; stroke-dashoffset: 0; }
@keyframes vz-draw { to { stroke-dashoffset: 0; } }
.lp-process .process-step { transition: transform .3s var(--ease); }
.lp-process li:hover .process-step { transform: translateX(4px) rotate(-6deg); }

/* ---- CTA: pattern sweep ---- */
.lp-cta { background: var(--orange); color: var(--white); position: relative; overflow: hidden; padding-block: clamp(64px, 9vw, 120px); }
.lp-cta::before {
	content: ''; position: absolute; inset: -20% -10%; pointer-events: none; opacity: .18;
	background: url('../img/pattern.svg') 0 0 / 122px 67px; animation: vz-sweep 40s linear infinite;
}
html.reduce-motion .lp-cta::before { animation: none; }
@keyframes vz-sweep { to { background-position: -244px 134px; } }
.lp-cta-inner { position: relative; text-align: center; max-width: 720px; }
.lp-cta-title { font-size: clamp(34px, 5vw, 64px); font-weight: 900; line-height: 1; margin: 0 0 16px; }
.lp-cta p { font-size: 19px; margin: 0; }
.lp-cta .btn-row { justify-content: center; }
.lp-cta .btn-white { color: var(--orange-2); }

/* ---- Portfolio archive ---- */
.pf-hero { overflow: hidden; }
.pf-hero .hero-steps { display: none; }
.pf-hero .container { position: relative; z-index: 1; }
.pf-title { font-size: clamp(36px, 5.4vw, 68px); font-weight: 900; line-height: 1; letter-spacing: -.02em; max-width: 16ch; }
.pf-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.pf-filter .chips { margin-top: 20px; }
.pf-count { margin: 20px 0 0; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); font-weight: 700; }
.chip-count { margin-left: 6px; font-size: 12px; opacity: .7; }

.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; gap: clamp(20px, 3vw, 36px) clamp(16px, 2.4vw, 28px); grid-auto-flow: dense; }
.pf-grid .project-card.is-tall { grid-row: span 2; }
.pf-grid .project-card.is-tall .project-card-media img, .pf-grid .project-card.is-tall .thumb-placeholder { aspect-ratio: 3 / 4; height: 100%; }
.pf-grid .project-card-media { position: relative; display: block; }
.project-card-overlay {
	position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 20px 8%;
	background: linear-gradient(transparent 55%, rgba(11, 39, 59, .85)); opacity: 0; transition: opacity .4s var(--ease);
}
.project-card-view { display: inline-flex; align-items: center; gap: 8px; color: var(--white); font-weight: 700; transform: translateY(12px); transition: transform .45s var(--ease); }
.project-card-view .icon { width: 18px; height: 18px; }
.project-card:hover .project-card-overlay, .project-card-media:focus-visible .project-card-overlay { opacity: 1; }
.project-card:hover .project-card-view { transform: none; }
.project-card-media img { transition: transform .8s var(--ease); }
@media (max-width: 900px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pf-grid { grid-template-columns: 1fr; } .pf-grid .project-card.is-tall { grid-row: auto; } .pf-grid .project-card.is-tall .project-card-media img { aspect-ratio: 4 / 3; height: auto; } }

/* ---- Photo slider (project pages) ---- */
.gallery { position: relative; outline-offset: 6px; }
.gallery-track {
	display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
	clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%); background: var(--navy-2);
}
.gallery-track::-webkit-scrollbar { display: none; }
html.reduce-motion .gallery-track { scroll-behavior: auto; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; margin: 0; }
.gallery-slide img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.gallery-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 6% 18px; color: var(--white); font-size: 15px; font-weight: 500; background: linear-gradient(transparent, rgba(11, 39, 59, .8)); }
.gallery-ui { position: absolute; right: 5%; bottom: 18px; display: flex; align-items: center; gap: 6px; z-index: 2; }
.gallery-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: var(--orange); color: var(--white); cursor: pointer; clip-path: var(--step-clip); transition: background .2s, transform .2s var(--ease); }
.gallery-btn:hover { background: var(--orange-2); }
.gallery-btn[data-dir="1"]:hover { transform: translateX(2px); }
.gallery-btn[data-dir="-1"]:hover { transform: translateX(-2px); }
.gallery-btn .icon { width: 20px; height: 20px; }
.gallery-count { padding: 0 12px; color: var(--white); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(11, 39, 59, .7); line-height: 44px; }
.gallery-dots { list-style: none; margin: 14px 0 0; padding: 0; display: flex; justify-content: center; gap: 8px; }
.gallery-dots button { width: 22px; height: 6px; border: 0; padding: 0; background: var(--rule); cursor: pointer; clip-path: var(--step-clip); transition: background .2s; }
.gallery-dots button.is-active { background: var(--orange); }
.project-cover.is-gallery { padding-bottom: 8px; }
@media (max-width: 600px) {
	.gallery-slide img { aspect-ratio: 4 / 3; }
	.gallery-ui { right: 4%; bottom: 12px; }
	.gallery-btn { width: 40px; height: 40px; }
	.gallery-count { line-height: 40px; }
}

/* ---- Single project: parallax cover ---- */
.project-cover .parallax { overflow: hidden; clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%); }
.project-cover .parallax img { clip-path: none; will-change: transform; }
